/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Allwinner SoCs display driver.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include "de_gamma_type.h"
#include "de_gamma.h"
#include "de_gamma_platform.h"

short g_gamma_funcs[17][1024] = {
	{ 0,    0,    0,    0,    0,    0,    1,    1,    1,    1,    1,
	  1,    1,    2,    2,    2,    2,    2,    3,    3,    3,    3,
	  3,    4,    4,    4,    4,    5,    5,    5,    6,    6,    6,
	  6,    7,    7,    7,    8,    8,    8,    8,    9,    9,    9,
	  10,   10,   10,   11,   11,   11,   12,   12,   12,   13,   13,
	  14,   14,   14,   15,   15,   15,   16,   16,   17,   17,   17,
	  18,   18,   19,   19,   19,   20,   20,   21,   21,   21,   22,
	  22,   23,   23,   24,   24,   24,   25,   25,   26,   26,   27,
	  27,   28,   28,   28,   29,   29,   30,   30,   31,   31,   32,
	  32,   33,   33,   34,   34,   35,   35,   36,   36,   37,   37,
	  38,   38,   39,   39,   40,   40,   41,   41,   42,   42,   43,
	  43,   44,   44,   45,   46,   46,   47,   47,   48,   48,   49,
	  49,   50,   51,   51,   52,   52,   53,   53,   54,   54,   55,
	  56,   56,   57,   57,   58,   59,   59,   60,   60,   61,   61,
	  62,   63,   63,   64,   64,   65,   66,   66,   67,   67,   68,
	  69,   69,   70,   71,   71,   72,   72,   73,   74,   74,   75,
	  76,   76,   77,   78,   78,   79,   79,   80,   81,   81,   82,
	  83,   83,   84,   85,   85,   86,   87,   87,   88,   89,   89,
	  90,   91,   91,   92,   93,   93,   94,   95,   95,   96,   97,
	  98,   98,   99,   100,  100,  101,  102,  102,  103,  104,  105,
	  105,  106,  107,  107,  108,  109,  109,  110,  111,  112,  112,
	  113,  114,  115,  115,  116,  117,  117,  118,  119,  120,  120,
	  121,  122,  123,  123,  124,  125,  126,  126,  127,  128,  129,
	  129,  130,  131,  132,  132,  133,  134,  135,  135,  136,  137,
	  138,  139,  139,  140,  141,  142,  142,  143,  144,  145,  146,
	  146,  147,  148,  149,  150,  150,  151,  152,  153,  154,  154,
	  155,  156,  157,  158,  158,  159,  160,  161,  162,  162,  163,
	  164,  165,  166,  166,  167,  168,  169,  170,  171,  171,  172,
	  173,  174,  175,  176,  176,  177,  178,  179,  180,  181,  181,
	  182,  183,  184,  185,  186,  187,  187,  188,  189,  190,  191,
	  192,  193,  193,  194,  195,  196,  197,  198,  199,  200,  200,
	  201,  202,  203,  204,  205,  206,  207,  207,  208,  209,  210,
	  211,  212,  213,  214,  214,  215,  216,  217,  218,  219,  220,
	  221,  222,  223,  223,  224,  225,  226,  227,  228,  229,  230,
	  231,  232,  233,  233,  234,  235,  236,  237,  238,  239,  240,
	  241,  242,  243,  244,  245,  245,  246,  247,  248,  249,  250,
	  251,  252,  253,  254,  255,  256,  257,  258,  259,  260,  261,
	  261,  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
	  272,  273,  274,  275,  276,  277,  278,  279,  280,  281,  282,
	  283,  284,  285,  286,  287,  288,  289,  290,  291,  292,  292,
	  293,  294,  295,  296,  297,  298,  299,  300,  301,  302,  303,
	  304,  305,  306,  307,  308,  309,  310,  311,  312,  313,  314,
	  315,  316,  317,  318,  319,  321,  322,  323,  324,  325,  326,
	  327,  328,  329,  330,  331,  332,  333,  334,  335,  336,  337,
	  338,  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
	  349,  350,  351,  353,  354,  355,  356,  357,  358,  359,  360,
	  361,  362,  363,  364,  365,  366,  367,  368,  369,  370,  372,
	  373,  374,  375,  376,  377,  378,  379,  380,  381,  382,  383,
	  384,  385,  387,  388,  389,  390,  391,  392,  393,  394,  395,
	  396,  397,  398,  400,  401,  402,  403,  404,  405,  406,  407,
	  408,  409,  411,  412,  413,  414,  415,  416,  417,  418,  419,
	  420,  422,  423,  424,  425,  426,  427,  428,  429,  430,  432,
	  433,  434,  435,  436,  437,  438,  439,  441,  442,  443,  444,
	  445,  446,  447,  448,  450,  451,  452,  453,  454,  455,  456,
	  458,  459,  460,  461,  462,  463,  464,  466,  467,  468,  469,
	  470,  471,  472,  474,  475,  476,  477,  478,  479,  481,  482,
	  483,  484,  485,  486,  488,  489,  490,  491,  492,  493,  495,
	  496,  497,  498,  499,  500,  502,  503,  504,  505,  506,  507,
	  509,  510,  511,  512,  513,  515,  516,  517,  518,  519,  520,
	  522,  523,  524,  525,  526,  528,  529,  530,  531,  532,  534,
	  535,  536,  537,  538,  540,  541,  542,  543,  544,  546,  547,
	  548,  549,  550,  552,  553,  554,  555,  557,  558,  559,  560,
	  561,  563,  564,  565,  566,  567,  569,  570,  571,  572,  574,
	  575,  576,  577,  579,  580,  581,  582,  583,  585,  586,  587,
	  588,  590,  591,  592,  593,  595,  596,  597,  598,  600,  601,
	  602,  603,  605,  606,  607,  608,  610,  611,  612,  613,  615,
	  616,  617,  618,  620,  621,  622,  623,  625,  626,  627,  628,
	  630,  631,  632,  633,  635,  636,  637,  639,  640,  641,  642,
	  644,  645,  646,  647,  649,  650,  651,  653,  654,  655,  656,
	  658,  659,  660,  662,  663,  664,  665,  667,  668,  669,  671,
	  672,  673,  674,  676,  677,  678,  680,  681,  682,  683,  685,
	  686,  687,  689,  690,  691,  693,  694,  695,  697,  698,  699,
	  700,  702,  703,  704,  706,  707,  708,  710,  711,  712,  714,
	  715,  716,  718,  719,  720,  721,  723,  724,  725,  727,  728,
	  729,  731,  732,  733,  735,  736,  737,  739,  740,  741,  743,
	  744,  745,  747,  748,  749,  751,  752,  753,  755,  756,  757,
	  759,  760,  761,  763,  764,  766,  767,  768,  770,  771,  772,
	  774,  775,  776,  778,  779,  780,  782,  783,  784,  786,  787,
	  789,  790,  791,  793,  794,  795,  797,  798,  799,  801,  802,
	  804,  805,  806,  808,  809,  810,  812,  813,  815,  816,  817,
	  819,  820,  821,  823,  824,  826,  827,  828,  830,  831,  832,
	  834,  835,  837,  838,  839,  841,  842,  844,  845,  846,  848,
	  849,  851,  852,  853,  855,  856,  857,  859,  860,  862,  863,
	  864,  866,  867,  869,  870,  871,  873,  874,  876,  877,  879,
	  880,  881,  883,  884,  886,  887,  888,  890,  891,  893,  894,
	  895,  897,  898,  900,  901,  903,  904,  905,  907,  908,  910,
	  911,  913,  914,  915,  917,  918,  920,  921,  923,  924,  925,
	  927,  928,  930,  931,  933,  934,  935,  937,  938,  940,  941,
	  943,  944,  946,  947,  948,  950,  951,  953,  954,  956,  957,
	  959,  960,  961,  963,  964,  966,  967,  969,  970,  972,  973,
	  975,  976,  977,  979,  980,  982,  983,  985,  986,  988,  989,
	  991,  992,  994,  995,  996,  998,  999,  1001, 1002, 1004, 1005,
	  1007, 1008, 1010, 1011, 1013, 1014, 1016, 1017, 1019, 1020, 1022,
	  1023 },
	{ 0,    0,    0,    0,    0,    1,    1,    1,    1,    1,    1,
	  2,    2,    2,    2,    3,    3,    3,    3,    4,    4,    4,
	  4,    5,    5,    5,    6,    6,    6,    6,    7,    7,    7,
	  8,    8,    8,    9,    9,    10,   10,   10,   11,   11,   11,
	  12,   12,   13,   13,   13,   14,   14,   14,   15,   15,   16,
	  16,   17,   17,   17,   18,   18,   19,   19,   20,   20,   20,
	  21,   21,   22,   22,   23,   23,   24,   24,   25,   25,   26,
	  26,   26,   27,   27,   28,   28,   29,   29,   30,   30,   31,
	  31,   32,   32,   33,   33,   34,   34,   35,   36,   36,   37,
	  37,   38,   38,   39,   39,   40,   40,   41,   41,   42,   43,
	  43,   44,   44,   45,   45,   46,   46,   47,   48,   48,   49,
	  49,   50,   51,   51,   52,   52,   53,   53,   54,   55,   55,
	  56,   56,   57,   58,   58,   59,   59,   60,   61,   61,   62,
	  63,   63,   64,   64,   65,   66,   66,   67,   68,   68,   69,
	  70,   70,   71,   71,   72,   73,   73,   74,   75,   75,   76,
	  77,   77,   78,   79,   79,   80,   81,   81,   82,   83,   83,
	  84,   85,   85,   86,   87,   87,   88,   89,   90,   90,   91,
	  92,   92,   93,   94,   94,   95,   96,   97,   97,   98,   99,
	  99,   100,  101,  101,  102,  103,  104,  104,  105,  106,  107,
	  107,  108,  109,  109,  110,  111,  112,  112,  113,  114,  115,
	  115,  116,  117,  118,  118,  119,  120,  121,  121,  122,  123,
	  124,  124,  125,  126,  127,  127,  128,  129,  130,  131,  131,
	  132,  133,  134,  134,  135,  136,  137,  138,  138,  139,  140,
	  141,  141,  142,  143,  144,  145,  145,  146,  147,  148,  149,
	  149,  150,  151,  152,  153,  153,  154,  155,  156,  157,  158,
	  158,  159,  160,  161,  162,  162,  163,  164,  165,  166,  167,
	  167,  168,  169,  170,  171,  172,  172,  173,  174,  175,  176,
	  177,  178,  178,  179,  180,  181,  182,  183,  183,  184,  185,
	  186,  187,  188,  189,  189,  190,  191,  192,  193,  194,  195,
	  196,  196,  197,  198,  199,  200,  201,  202,  203,  203,  204,
	  205,  206,  207,  208,  209,  210,  211,  211,  212,  213,  214,
	  215,  216,  217,  218,  219,  219,  220,  221,  222,  223,  224,
	  225,  226,  227,  228,  229,  229,  230,  231,  232,  233,  234,
	  235,  236,  237,  238,  239,  240,  240,  241,  242,  243,  244,
	  245,  246,  247,  248,  249,  250,  251,  252,  253,  254,  254,
	  255,  256,  257,  258,  259,  260,  261,  262,  263,  264,  265,
	  266,  267,  268,  269,  270,  271,  272,  273,  273,  274,  275,
	  276,  277,  278,  279,  280,  281,  282,  283,  284,  285,  286,
	  287,  288,  289,  290,  291,  292,  293,  294,  295,  296,  297,
	  298,  299,  300,  301,  302,  303,  304,  305,  306,  307,  308,
	  309,  310,  311,  312,  313,  314,  315,  316,  317,  318,  319,
	  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,  330,
	  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,  341,
	  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
	  353,  354,  356,  357,  358,  359,  360,  361,  362,  363,  364,
	  365,  366,  367,  368,  369,  370,  371,  372,  373,  374,  375,
	  376,  378,  379,  380,  381,  382,  383,  384,  385,  386,  387,
	  388,  389,  390,  391,  392,  393,  395,  396,  397,  398,  399,
	  400,  401,  402,  403,  404,  405,  406,  407,  409,  410,  411,
	  412,  413,  414,  415,  416,  417,  418,  419,  421,  422,  423,
	  424,  425,  426,  427,  428,  429,  430,  431,  433,  434,  435,
	  436,  437,  438,  439,  440,  441,  443,  444,  445,  446,  447,
	  448,  449,  450,  451,  453,  454,  455,  456,  457,  458,  459,
	  460,  461,  463,  464,  465,  466,  467,  468,  469,  470,  472,
	  473,  474,  475,  476,  477,  478,  480,  481,  482,  483,  484,
	  485,  486,  488,  489,  490,  491,  492,  493,  494,  496,  497,
	  498,  499,  500,  501,  502,  504,  505,  506,  507,  508,  509,
	  510,  512,  513,  514,  515,  516,  517,  519,  520,  521,  522,
	  523,  524,  526,  527,  528,  529,  530,  531,  533,  534,  535,
	  536,  537,  538,  540,  541,  542,  543,  544,  546,  547,  548,
	  549,  550,  551,  553,  554,  555,  556,  557,  559,  560,  561,
	  562,  563,  564,  566,  567,  568,  569,  570,  572,  573,  574,
	  575,  576,  578,  579,  580,  581,  582,  584,  585,  586,  587,
	  588,  590,  591,  592,  593,  594,  596,  597,  598,  599,  601,
	  602,  603,  604,  605,  607,  608,  609,  610,  611,  613,  614,
	  615,  616,  618,  619,  620,  621,  622,  624,  625,  626,  627,
	  629,  630,  631,  632,  634,  635,  636,  637,  638,  640,  641,
	  642,  643,  645,  646,  647,  648,  650,  651,  652,  653,  655,
	  656,  657,  658,  660,  661,  662,  663,  665,  666,  667,  668,
	  670,  671,  672,  673,  675,  676,  677,  678,  680,  681,  682,
	  683,  685,  686,  687,  688,  690,  691,  692,  693,  695,  696,
	  697,  699,  700,  701,  702,  704,  705,  706,  707,  709,  710,
	  711,  713,  714,  715,  716,  718,  719,  720,  722,  723,  724,
	  725,  727,  728,  729,  730,  732,  733,  734,  736,  737,  738,
	  740,  741,  742,  743,  745,  746,  747,  749,  750,  751,  752,
	  754,  755,  756,  758,  759,  760,  762,  763,  764,  765,  767,
	  768,  769,  771,  772,  773,  775,  776,  777,  778,  780,  781,
	  782,  784,  785,  786,  788,  789,  790,  792,  793,  794,  796,
	  797,  798,  800,  801,  802,  804,  805,  806,  807,  809,  810,
	  811,  813,  814,  815,  817,  818,  819,  821,  822,  823,  825,
	  826,  827,  829,  830,  831,  833,  834,  835,  837,  838,  839,
	  841,  842,  843,  845,  846,  847,  849,  850,  852,  853,  854,
	  856,  857,  858,  860,  861,  862,  864,  865,  866,  868,  869,
	  870,  872,  873,  874,  876,  877,  879,  880,  881,  883,  884,
	  885,  887,  888,  889,  891,  892,  894,  895,  896,  898,  899,
	  900,  902,  903,  904,  906,  907,  909,  910,  911,  913,  914,
	  915,  917,  918,  920,  921,  922,  924,  925,  926,  928,  929,
	  931,  932,  933,  935,  936,  937,  939,  940,  942,  943,  944,
	  946,  947,  949,  950,  951,  953,  954,  956,  957,  958,  960,
	  961,  962,  964,  965,  967,  968,  969,  971,  972,  974,  975,
	  976,  978,  979,  981,  982,  983,  985,  986,  988,  989,  990,
	  992,  993,  995,  996,  998,  999,  1000, 1002, 1003, 1005, 1006,
	  1007, 1009, 1010, 1012, 1013, 1014, 1016, 1017, 1019, 1020, 1022,
	  1023 },
	{ 0,    0,    0,    0,    1,    1,    1,    1,    1,    2,    2,
	  2,    2,    3,    3,    3,    4,    4,    4,    5,    5,    5,
	  6,    6,    6,    7,    7,    7,    8,    8,    8,    9,    9,
	  10,   10,   10,   11,   11,   12,   12,   12,   13,   13,   14,
	  14,   15,   15,   16,   16,   16,   17,   17,   18,   18,   19,
	  19,   20,   20,   21,   21,   22,   22,   23,   23,   24,   24,
	  25,   25,   26,   26,   27,   27,   28,   28,   29,   29,   30,
	  30,   31,   31,   32,   33,   33,   34,   34,   35,   35,   36,
	  36,   37,   38,   38,   39,   39,   40,   40,   41,   42,   42,
	  43,   43,   44,   44,   45,   46,   46,   47,   47,   48,   49,
	  49,   50,   51,   51,   52,   52,   53,   54,   54,   55,   55,
	  56,   57,   57,   58,   59,   59,   60,   61,   61,   62,   63,
	  63,   64,   64,   65,   66,   66,   67,   68,   68,   69,   70,
	  70,   71,   72,   72,   73,   74,   74,   75,   76,   77,   77,
	  78,   79,   79,   80,   81,   81,   82,   83,   83,   84,   85,
	  86,   86,   87,   88,   88,   89,   90,   91,   91,   92,   93,
	  93,   94,   95,   96,   96,   97,   98,   98,   99,   100,  101,
	  101,  102,  103,  104,  104,  105,  106,  107,  107,  108,  109,
	  110,  110,  111,  112,  113,  113,  114,  115,  116,  116,  117,
	  118,  119,  120,  120,  121,  122,  123,  123,  124,  125,  126,
	  127,  127,  128,  129,  130,  130,  131,  132,  133,  134,  134,
	  135,  136,  137,  138,  138,  139,  140,  141,  142,  142,  143,
	  144,  145,  146,  146,  147,  148,  149,  150,  151,  151,  152,
	  153,  154,  155,  155,  156,  157,  158,  159,  160,  160,  161,
	  162,  163,  164,  165,  165,  166,  167,  168,  169,  170,  171,
	  171,  172,  173,  174,  175,  176,  176,  177,  178,  179,  180,
	  181,  182,  182,  183,  184,  185,  186,  187,  188,  189,  189,
	  190,  191,  192,  193,  194,  195,  196,  196,  197,  198,  199,
	  200,  201,  202,  203,  203,  204,  205,  206,  207,  208,  209,
	  210,  211,  211,  212,  213,  214,  215,  216,  217,  218,  219,
	  220,  221,  221,  222,  223,  224,  225,  226,  227,  228,  229,
	  230,  231,  231,  232,  233,  234,  235,  236,  237,  238,  239,
	  240,  241,  242,  243,  243,  244,  245,  246,  247,  248,  249,
	  250,  251,  252,  253,  254,  255,  256,  257,  258,  258,  259,
	  260,  261,  262,  263,  264,  265,  266,  267,  268,  269,  270,
	  271,  272,  273,  274,  275,  276,  277,  278,  278,  279,  280,
	  281,  282,  283,  284,  285,  286,  287,  288,  289,  290,  291,
	  292,  293,  294,  295,  296,  297,  298,  299,  300,  301,  302,
	  303,  304,  305,  306,  307,  308,  309,  310,  311,  312,  313,
	  314,  315,  316,  317,  318,  319,  320,  321,  322,  323,  324,
	  325,  326,  327,  328,  329,  330,  331,  332,  333,  334,  335,
	  336,  337,  338,  339,  340,  341,  342,  343,  344,  345,  346,
	  347,  348,  349,  350,  351,  352,  353,  354,  355,  356,  357,
	  358,  359,  360,  361,  362,  363,  365,  366,  367,  368,  369,
	  370,  371,  372,  373,  374,  375,  376,  377,  378,  379,  380,
	  381,  382,  383,  384,  385,  386,  387,  389,  390,  391,  392,
	  393,  394,  395,  396,  397,  398,  399,  400,  401,  402,  403,
	  404,  405,  407,  408,  409,  410,  411,  412,  413,  414,  415,
	  416,  417,  418,  419,  420,  421,  423,  424,  425,  426,  427,
	  428,  429,  430,  431,  432,  433,  434,  436,  437,  438,  439,
	  440,  441,  442,  443,  444,  445,  446,  448,  449,  450,  451,
	  452,  453,  454,  455,  456,  457,  458,  460,  461,  462,  463,
	  464,  465,  466,  467,  468,  470,  471,  472,  473,  474,  475,
	  476,  477,  478,  479,  481,  482,  483,  484,  485,  486,  487,
	  488,  490,  491,  492,  493,  494,  495,  496,  497,  499,  500,
	  501,  502,  503,  504,  505,  506,  508,  509,  510,  511,  512,
	  513,  514,  515,  517,  518,  519,  520,  521,  522,  523,  525,
	  526,  527,  528,  529,  530,  531,  533,  534,  535,  536,  537,
	  538,  539,  541,  542,  543,  544,  545,  546,  547,  549,  550,
	  551,  552,  553,  554,  556,  557,  558,  559,  560,  561,  563,
	  564,  565,  566,  567,  568,  569,  571,  572,  573,  574,  575,
	  576,  578,  579,  580,  581,  582,  584,  585,  586,  587,  588,
	  589,  591,  592,  593,  594,  595,  596,  598,  599,  600,  601,
	  602,  604,  605,  606,  607,  608,  609,  611,  612,  613,  614,
	  615,  617,  618,  619,  620,  621,  623,  624,  625,  626,  627,
	  628,  630,  631,  632,  633,  634,  636,  637,  638,  639,  640,
	  642,  643,  644,  645,  646,  648,  649,  650,  651,  653,  654,
	  655,  656,  657,  659,  660,  661,  662,  663,  665,  666,  667,
	  668,  669,  671,  672,  673,  674,  676,  677,  678,  679,  680,
	  682,  683,  684,  685,  687,  688,  689,  690,  691,  693,  694,
	  695,  696,  698,  699,  700,  701,  703,  704,  705,  706,  707,
	  709,  710,  711,  712,  714,  715,  716,  717,  719,  720,  721,
	  722,  724,  725,  726,  727,  728,  730,  731,  732,  733,  735,
	  736,  737,  738,  740,  741,  742,  743,  745,  746,  747,  748,
	  750,  751,  752,  753,  755,  756,  757,  758,  760,  761,  762,
	  764,  765,  766,  767,  769,  770,  771,  772,  774,  775,  776,
	  777,  779,  780,  781,  782,  784,  785,  786,  788,  789,  790,
	  791,  793,  794,  795,  796,  798,  799,  800,  802,  803,  804,
	  805,  807,  808,  809,  810,  812,  813,  814,  816,  817,  818,
	  819,  821,  822,  823,  825,  826,  827,  828,  830,  831,  832,
	  834,  835,  836,  837,  839,  840,  841,  843,  844,  845,  846,
	  848,  849,  850,  852,  853,  854,  856,  857,  858,  859,  861,
	  862,  863,  865,  866,  867,  869,  870,  871,  872,  874,  875,
	  876,  878,  879,  880,  882,  883,  884,  886,  887,  888,  889,
	  891,  892,  893,  895,  896,  897,  899,  900,  901,  903,  904,
	  905,  907,  908,  909,  910,  912,  913,  914,  916,  917,  918,
	  920,  921,  922,  924,  925,  926,  928,  929,  930,  932,  933,
	  934,  936,  937,  938,  940,  941,  942,  944,  945,  946,  948,
	  949,  950,  952,  953,  954,  956,  957,  958,  960,  961,  962,
	  964,  965,  966,  968,  969,  970,  972,  973,  974,  976,  977,
	  978,  980,  981,  982,  984,  985,  986,  988,  989,  990,  992,
	  993,  995,  996,  997,  999,  1000, 1001, 1003, 1004, 1005, 1007,
	  1008, 1009, 1011, 1012, 1013, 1015, 1016, 1018, 1019, 1020, 1022,
	  1023 },
	{ 0,    0,    0,    1,    1,    1,    1,    2,    2,    2,    2,
	  3,    3,    4,    4,    4,    5,    5,    5,    6,    6,    7,
	  7,    7,    8,    8,    9,    9,    10,   10,   10,   11,   11,
	  12,   12,   13,   13,   14,   14,   15,   15,   16,   16,   17,
	  17,   18,   18,   19,   19,   20,   20,   21,   21,   22,   22,
	  23,   23,   24,   25,   25,   26,   26,   27,   27,   28,   28,
	  29,   30,   30,   31,   31,   32,   32,   33,   34,   34,   35,
	  35,   36,   37,   37,   38,   38,   39,   40,   40,   41,   42,
	  42,   43,   43,   44,   45,   45,   46,   47,   47,   48,   48,
	  49,   50,   50,   51,   52,   52,   53,   54,   54,   55,   56,
	  56,   57,   58,   58,   59,   60,   60,   61,   62,   62,   63,
	  64,   64,   65,   66,   67,   67,   68,   69,   69,   70,   71,
	  71,   72,   73,   74,   74,   75,   76,   76,   77,   78,   79,
	  79,   80,   81,   81,   82,   83,   84,   84,   85,   86,   87,
	  87,   88,   89,   89,   90,   91,   92,   92,   93,   94,   95,
	  95,   96,   97,   98,   98,   99,   100,  101,  102,  102,  103,
	  104,  105,  105,  106,  107,  108,  108,  109,  110,  111,  112,
	  112,  113,  114,  115,  115,  116,  117,  118,  119,  119,  120,
	  121,  122,  123,  123,  124,  125,  126,  127,  127,  128,  129,
	  130,  131,  131,  132,  133,  134,  135,  135,  136,  137,  138,
	  139,  140,  140,  141,  142,  143,  144,  145,  145,  146,  147,
	  148,  149,  149,  150,  151,  152,  153,  154,  155,  155,  156,
	  157,  158,  159,  160,  160,  161,  162,  163,  164,  165,  166,
	  166,  167,  168,  169,  170,  171,  172,  172,  173,  174,  175,
	  176,  177,  178,  178,  179,  180,  181,  182,  183,  184,  185,
	  185,  186,  187,  188,  189,  190,  191,  192,  192,  193,  194,
	  195,  196,  197,  198,  199,  200,  200,  201,  202,  203,  204,
	  205,  206,  207,  208,  209,  209,  210,  211,  212,  213,  214,
	  215,  216,  217,  218,  218,  219,  220,  221,  222,  223,  224,
	  225,  226,  227,  228,  229,  229,  230,  231,  232,  233,  234,
	  235,  236,  237,  238,  239,  240,  241,  242,  242,  243,  244,
	  245,  246,  247,  248,  249,  250,  251,  252,  253,  254,  255,
	  256,  257,  257,  258,  259,  260,  261,  262,  263,  264,  265,
	  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,  276,
	  277,  278,  278,  279,  280,  281,  282,  283,  284,  285,  286,
	  287,  288,  289,  290,  291,  292,  293,  294,  295,  296,  297,
	  298,  299,  300,  301,  302,  303,  304,  305,  306,  307,  308,
	  309,  310,  311,  312,  313,  314,  315,  316,  317,  318,  319,
	  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,  330,
	  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,  341,
	  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
	  353,  354,  355,  356,  357,  358,  359,  360,  361,  362,  363,
	  364,  365,  366,  367,  368,  369,  370,  371,  372,  373,  374,
	  375,  376,  377,  378,  379,  380,  381,  383,  384,  385,  386,
	  387,  388,  389,  390,  391,  392,  393,  394,  395,  396,  397,
	  398,  399,  400,  401,  402,  403,  404,  405,  407,  408,  409,
	  410,  411,  412,  413,  414,  415,  416,  417,  418,  419,  420,
	  421,  422,  423,  424,  426,  427,  428,  429,  430,  431,  432,
	  433,  434,  435,  436,  437,  438,  439,  440,  442,  443,  444,
	  445,  446,  447,  448,  449,  450,  451,  452,  453,  454,  455,
	  457,  458,  459,  460,  461,  462,  463,  464,  465,  466,  467,
	  468,  470,  471,  472,  473,  474,  475,  476,  477,  478,  479,
	  480,  482,  483,  484,  485,  486,  487,  488,  489,  490,  491,
	  493,  494,  495,  496,  497,  498,  499,  500,  501,  502,  504,
	  505,  506,  507,  508,  509,  510,  511,  512,  513,  515,  516,
	  517,  518,  519,  520,  521,  522,  523,  525,  526,  527,  528,
	  529,  530,  531,  532,  534,  535,  536,  537,  538,  539,  540,
	  541,  542,  544,  545,  546,  547,  548,  549,  550,  551,  553,
	  554,  555,  556,  557,  558,  559,  561,  562,  563,  564,  565,
	  566,  567,  568,  570,  571,  572,  573,  574,  575,  576,  578,
	  579,  580,  581,  582,  583,  584,  586,  587,  588,  589,  590,
	  591,  592,  594,  595,  596,  597,  598,  599,  600,  602,  603,
	  604,  605,  606,  607,  608,  610,  611,  612,  613,  614,  615,
	  617,  618,  619,  620,  621,  622,  624,  625,  626,  627,  628,
	  629,  630,  632,  633,  634,  635,  636,  637,  639,  640,  641,
	  642,  643,  644,  646,  647,  648,  649,  650,  652,  653,  654,
	  655,  656,  657,  659,  660,  661,  662,  663,  664,  666,  667,
	  668,  669,  670,  671,  673,  674,  675,  676,  677,  679,  680,
	  681,  682,  683,  684,  686,  687,  688,  689,  690,  692,  693,
	  694,  695,  696,  698,  699,  700,  701,  702,  704,  705,  706,
	  707,  708,  709,  711,  712,  713,  714,  715,  717,  718,  719,
	  720,  721,  723,  724,  725,  726,  727,  729,  730,  731,  732,
	  733,  735,  736,  737,  738,  739,  741,  742,  743,  744,  746,
	  747,  748,  749,  750,  752,  753,  754,  755,  756,  758,  759,
	  760,  761,  762,  764,  765,  766,  767,  769,  770,  771,  772,
	  773,  775,  776,  777,  778,  780,  781,  782,  783,  784,  786,
	  787,  788,  789,  791,  792,  793,  794,  795,  797,  798,  799,
	  800,  802,  803,  804,  805,  807,  808,  809,  810,  811,  813,
	  814,  815,  816,  818,  819,  820,  821,  823,  824,  825,  826,
	  827,  829,  830,  831,  832,  834,  835,  836,  837,  839,  840,
	  841,  842,  844,  845,  846,  847,  849,  850,  851,  852,  854,
	  855,  856,  857,  859,  860,  861,  862,  864,  865,  866,  867,
	  869,  870,  871,  872,  874,  875,  876,  877,  879,  880,  881,
	  882,  884,  885,  886,  887,  889,  890,  891,  892,  894,  895,
	  896,  897,  899,  900,  901,  903,  904,  905,  906,  908,  909,
	  910,  911,  913,  914,  915,  916,  918,  919,  920,  922,  923,
	  924,  925,  927,  928,  929,  930,  932,  933,  934,  935,  937,
	  938,  939,  941,  942,  943,  944,  946,  947,  948,  950,  951,
	  952,  953,  955,  956,  957,  958,  960,  961,  962,  964,  965,
	  966,  967,  969,  970,  971,  973,  974,  975,  976,  978,  979,
	  980,  982,  983,  984,  985,  987,  988,  989,  991,  992,  993,
	  994,  996,  997,  998,  1000, 1001, 1002, 1004, 1005, 1006, 1007,
	  1009, 1010, 1011, 1013, 1014, 1015, 1017, 1018, 1019, 1020, 1022,
	  1023 },
	{ 0,    0,    0,    1,    1,    1,    2,    2,    2,    3,    3,
	  4,    4,    5,    5,    5,    6,    6,    7,    7,    8,    8,
	  9,    9,    10,   10,   11,   11,   12,   12,   13,   13,   14,
	  14,   15,   16,   16,   17,   17,   18,   18,   19,   20,   20,
	  21,   21,   22,   22,   23,   24,   24,   25,   25,   26,   27,
	  27,   28,   29,   29,   30,   30,   31,   32,   32,   33,   34,
	  34,   35,   35,   36,   37,   37,   38,   39,   39,   40,   41,
	  41,   42,   43,   43,   44,   45,   45,   46,   47,   47,   48,
	  49,   50,   50,   51,   52,   52,   53,   54,   54,   55,   56,
	  57,   57,   58,   59,   59,   60,   61,   62,   62,   63,   64,
	  64,   65,   66,   67,   67,   68,   69,   70,   70,   71,   72,
	  72,   73,   74,   75,   75,   76,   77,   78,   78,   79,   80,
	  81,   82,   82,   83,   84,   85,   85,   86,   87,   88,   88,
	  89,   90,   91,   92,   92,   93,   94,   95,   95,   96,   97,
	  98,   99,   99,   100,  101,  102,  103,  103,  104,  105,  106,
	  106,  107,  108,  109,  110,  111,  111,  112,  113,  114,  115,
	  115,  116,  117,  118,  119,  119,  120,  121,  122,  123,  124,
	  124,  125,  126,  127,  128,  129,  129,  130,  131,  132,  133,
	  134,  134,  135,  136,  137,  138,  139,  139,  140,  141,  142,
	  143,  144,  144,  145,  146,  147,  148,  149,  150,  150,  151,
	  152,  153,  154,  155,  156,  156,  157,  158,  159,  160,  161,
	  162,  162,  163,  164,  165,  166,  167,  168,  169,  169,  170,
	  171,  172,  173,  174,  175,  176,  177,  177,  178,  179,  180,
	  181,  182,  183,  184,  184,  185,  186,  187,  188,  189,  190,
	  191,  192,  193,  193,  194,  195,  196,  197,  198,  199,  200,
	  201,  202,  202,  203,  204,  205,  206,  207,  208,  209,  210,
	  211,  212,  212,  213,  214,  215,  216,  217,  218,  219,  220,
	  221,  222,  223,  223,  224,  225,  226,  227,  228,  229,  230,
	  231,  232,  233,  234,  235,  236,  236,  237,  238,  239,  240,
	  241,  242,  243,  244,  245,  246,  247,  248,  249,  250,  251,
	  252,  252,  253,  254,  255,  256,  257,  258,  259,  260,  261,
	  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,  272,
	  272,  273,  274,  275,  276,  277,  278,  279,  280,  281,  282,
	  283,  284,  285,  286,  287,  288,  289,  290,  291,  292,  293,
	  294,  295,  296,  297,  298,  299,  300,  301,  302,  303,  304,
	  305,  305,  306,  307,  308,  309,  310,  311,  312,  313,  314,
	  315,  316,  317,  318,  319,  320,  321,  322,  323,  324,  325,
	  326,  327,  328,  329,  330,  331,  332,  333,  334,  335,  336,
	  337,  338,  339,  340,  341,  342,  343,  344,  345,  346,  347,
	  348,  349,  350,  351,  352,  353,  354,  355,  356,  357,  358,
	  359,  360,  361,  362,  363,  364,  365,  366,  367,  368,  369,
	  371,  372,  373,  374,  375,  376,  377,  378,  379,  380,  381,
	  382,  383,  384,  385,  386,  387,  388,  389,  390,  391,  392,
	  393,  394,  395,  396,  397,  398,  399,  400,  401,  402,  403,
	  404,  405,  406,  408,  409,  410,  411,  412,  413,  414,  415,
	  416,  417,  418,  419,  420,  421,  422,  423,  424,  425,  426,
	  427,  428,  429,  430,  432,  433,  434,  435,  436,  437,  438,
	  439,  440,  441,  442,  443,  444,  445,  446,  447,  448,  449,
	  451,  452,  453,  454,  455,  456,  457,  458,  459,  460,  461,
	  462,  463,  464,  465,  466,  467,  469,  470,  471,  472,  473,
	  474,  475,  476,  477,  478,  479,  480,  481,  482,  484,  485,
	  486,  487,  488,  489,  490,  491,  492,  493,  494,  495,  496,
	  498,  499,  500,  501,  502,  503,  504,  505,  506,  507,  508,
	  509,  510,  512,  513,  514,  515,  516,  517,  518,  519,  520,
	  521,  522,  524,  525,  526,  527,  528,  529,  530,  531,  532,
	  533,  534,  536,  537,  538,  539,  540,  541,  542,  543,  544,
	  545,  546,  548,  549,  550,  551,  552,  553,  554,  555,  556,
	  557,  559,  560,  561,  562,  563,  564,  565,  566,  567,  569,
	  570,  571,  572,  573,  574,  575,  576,  577,  579,  580,  581,
	  582,  583,  584,  585,  586,  587,  589,  590,  591,  592,  593,
	  594,  595,  596,  597,  599,  600,  601,  602,  603,  604,  605,
	  606,  608,  609,  610,  611,  612,  613,  614,  615,  617,  618,
	  619,  620,  621,  622,  623,  624,  626,  627,  628,  629,  630,
	  631,  632,  633,  635,  636,  637,  638,  639,  640,  641,  642,
	  644,  645,  646,  647,  648,  649,  650,  652,  653,  654,  655,
	  656,  657,  658,  660,  661,  662,  663,  664,  665,  666,  667,
	  669,  670,  671,  672,  673,  674,  675,  677,  678,  679,  680,
	  681,  682,  684,  685,  686,  687,  688,  689,  690,  692,  693,
	  694,  695,  696,  697,  698,  700,  701,  702,  703,  704,  705,
	  707,  708,  709,  710,  711,  712,  713,  715,  716,  717,  718,
	  719,  720,  722,  723,  724,  725,  726,  727,  729,  730,  731,
	  732,  733,  734,  735,  737,  738,  739,  740,  741,  742,  744,
	  745,  746,  747,  748,  749,  751,  752,  753,  754,  755,  756,
	  758,  759,  760,  761,  762,  764,  765,  766,  767,  768,  769,
	  771,  772,  773,  774,  775,  776,  778,  779,  780,  781,  782,
	  783,  785,  786,  787,  788,  789,  791,  792,  793,  794,  795,
	  796,  798,  799,  800,  801,  802,  804,  805,  806,  807,  808,
	  809,  811,  812,  813,  814,  815,  817,  818,  819,  820,  821,
	  823,  824,  825,  826,  827,  828,  830,  831,  832,  833,  834,
	  836,  837,  838,  839,  840,  842,  843,  844,  845,  846,  848,
	  849,  850,  851,  852,  854,  855,  856,  857,  858,  860,  861,
	  862,  863,  864,  866,  867,  868,  869,  870,  872,  873,  874,
	  875,  876,  878,  879,  880,  881,  882,  884,  885,  886,  887,
	  888,  890,  891,  892,  893,  894,  896,  897,  898,  899,  900,
	  902,  903,  904,  905,  907,  908,  909,  910,  911,  913,  914,
	  915,  916,  917,  919,  920,  921,  922,  924,  925,  926,  927,
	  928,  930,  931,  932,  933,  934,  936,  937,  938,  939,  941,
	  942,  943,  944,  945,  947,  948,  949,  950,  952,  953,  954,
	  955,  956,  958,  959,  960,  961,  963,  964,  965,  966,  967,
	  969,  970,  971,  972,  974,  975,  976,  977,  979,  980,  981,
	  982,  983,  985,  986,  987,  988,  990,  991,  992,  993,  995,
	  996,  997,  998,  999,  1001, 1002, 1003, 1004, 1006, 1007, 1008,
	  1009, 1011, 1012, 1013, 1014, 1016, 1017, 1018, 1019, 1021, 1022,
	  1023 },
	{ 0,    0,    1,    1,    1,    2,    2,    3,    3,    4,    4,
	  5,    5,    6,    6,    7,    8,    8,    9,    9,    10,   10,
	  11,   12,   12,   13,   13,   14,   15,   15,   16,   17,   17,
	  18,   18,   19,   20,   20,   21,   22,   22,   23,   24,   24,
	  25,   26,   26,   27,   28,   28,   29,   30,   30,   31,   32,
	  32,   33,   34,   35,   35,   36,   37,   37,   38,   39,   40,
	  40,   41,   42,   42,   43,   44,   45,   45,   46,   47,   48,
	  48,   49,   50,   51,   51,   52,   53,   54,   54,   55,   56,
	  57,   57,   58,   59,   60,   60,   61,   62,   63,   63,   64,
	  65,   66,   67,   67,   68,   69,   70,   70,   71,   72,   73,
	  74,   74,   75,   76,   77,   78,   78,   79,   80,   81,   82,
	  82,   83,   84,   85,   86,   86,   87,   88,   89,   90,   90,
	  91,   92,   93,   94,   95,   95,   96,   97,   98,   99,   100,
	  100,  101,  102,  103,  104,  105,  105,  106,  107,  108,  109,
	  110,  110,  111,  112,  113,  114,  115,  115,  116,  117,  118,
	  119,  120,  121,  121,  122,  123,  124,  125,  126,  126,  127,
	  128,  129,  130,  131,  132,  133,  133,  134,  135,  136,  137,
	  138,  139,  139,  140,  141,  142,  143,  144,  145,  146,  146,
	  147,  148,  149,  150,  151,  152,  153,  153,  154,  155,  156,
	  157,  158,  159,  160,  161,  161,  162,  163,  164,  165,  166,
	  167,  168,  169,  170,  170,  171,  172,  173,  174,  175,  176,
	  177,  178,  179,  179,  180,  181,  182,  183,  184,  185,  186,
	  187,  188,  189,  189,  190,  191,  192,  193,  194,  195,  196,
	  197,  198,  199,  200,  200,  201,  202,  203,  204,  205,  206,
	  207,  208,  209,  210,  211,  212,  212,  213,  214,  215,  216,
	  217,  218,  219,  220,  221,  222,  223,  224,  225,  225,  226,
	  227,  228,  229,  230,  231,  232,  233,  234,  235,  236,  237,
	  238,  239,  240,  241,  242,  242,  243,  244,  245,  246,  247,
	  248,  249,  250,  251,  252,  253,  254,  255,  256,  257,  258,
	  259,  260,  261,  262,  262,  263,  264,  265,  266,  267,  268,
	  269,  270,  271,  272,  273,  274,  275,  276,  277,  278,  279,
	  280,  281,  282,  283,  284,  285,  286,  287,  288,  289,  290,
	  290,  291,  292,  293,  294,  295,  296,  297,  298,  299,  300,
	  301,  302,  303,  304,  305,  306,  307,  308,  309,  310,  311,
	  312,  313,  314,  315,  316,  317,  318,  319,  320,  321,  322,
	  323,  324,  325,  326,  327,  328,  329,  330,  331,  332,  333,
	  334,  335,  336,  337,  338,  339,  340,  341,  342,  343,  344,
	  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,  355,
	  356,  357,  358,  359,  360,  361,  362,  363,  364,  365,  366,
	  367,  368,  369,  370,  371,  372,  373,  374,  375,  376,  377,
	  378,  379,  380,  381,  382,  383,  384,  385,  386,  387,  388,
	  389,  390,  391,  392,  393,  394,  395,  396,  397,  398,  399,
	  400,  401,  402,  403,  404,  406,  407,  408,  409,  410,  411,
	  412,  413,  414,  415,  416,  417,  418,  419,  420,  421,  422,
	  423,  424,  425,  426,  427,  428,  429,  430,  431,  432,  433,
	  434,  435,  436,  437,  439,  440,  441,  442,  443,  444,  445,
	  446,  447,  448,  449,  450,  451,  452,  453,  454,  455,  456,
	  457,  458,  459,  460,  461,  462,  464,  465,  466,  467,  468,
	  469,  470,  471,  472,  473,  474,  475,  476,  477,  478,  479,
	  480,  481,  482,  483,  484,  486,  487,  488,  489,  490,  491,
	  492,  493,  494,  495,  496,  497,  498,  499,  500,  501,  502,
	  503,  505,  506,  507,  508,  509,  510,  511,  512,  513,  514,
	  515,  516,  517,  518,  519,  520,  522,  523,  524,  525,  526,
	  527,  528,  529,  530,  531,  532,  533,  534,  535,  536,  538,
	  539,  540,  541,  542,  543,  544,  545,  546,  547,  548,  549,
	  550,  551,  553,  554,  555,  556,  557,  558,  559,  560,  561,
	  562,  563,  564,  565,  567,  568,  569,  570,  571,  572,  573,
	  574,  575,  576,  577,  578,  580,  581,  582,  583,  584,  585,
	  586,  587,  588,  589,  590,  591,  593,  594,  595,  596,  597,
	  598,  599,  600,  601,  602,  603,  604,  606,  607,  608,  609,
	  610,  611,  612,  613,  614,  615,  616,  618,  619,  620,  621,
	  622,  623,  624,  625,  626,  627,  629,  630,  631,  632,  633,
	  634,  635,  636,  637,  638,  639,  641,  642,  643,  644,  645,
	  646,  647,  648,  649,  650,  652,  653,  654,  655,  656,  657,
	  658,  659,  660,  662,  663,  664,  665,  666,  667,  668,  669,
	  670,  671,  673,  674,  675,  676,  677,  678,  679,  680,  681,
	  683,  684,  685,  686,  687,  688,  689,  690,  691,  693,  694,
	  695,  696,  697,  698,  699,  700,  701,  703,  704,  705,  706,
	  707,  708,  709,  710,  711,  713,  714,  715,  716,  717,  718,
	  719,  720,  722,  723,  724,  725,  726,  727,  728,  729,  730,
	  732,  733,  734,  735,  736,  737,  738,  739,  741,  742,  743,
	  744,  745,  746,  747,  748,  750,  751,  752,  753,  754,  755,
	  756,  757,  759,  760,  761,  762,  763,  764,  765,  766,  768,
	  769,  770,  771,  772,  773,  774,  776,  777,  778,  779,  780,
	  781,  782,  783,  785,  786,  787,  788,  789,  790,  791,  793,
	  794,  795,  796,  797,  798,  799,  800,  802,  803,  804,  805,
	  806,  807,  808,  810,  811,  812,  813,  814,  815,  816,  818,
	  819,  820,  821,  822,  823,  824,  826,  827,  828,  829,  830,
	  831,  832,  834,  835,  836,  837,  838,  839,  840,  842,  843,
	  844,  845,  846,  847,  848,  850,  851,  852,  853,  854,  855,
	  856,  858,  859,  860,  861,  862,  863,  865,  866,  867,  868,
	  869,  870,  871,  873,  874,  875,  876,  877,  878,  879,  881,
	  882,  883,  884,  885,  886,  888,  889,  890,  891,  892,  893,
	  894,  896,  897,  898,  899,  900,  901,  903,  904,  905,  906,
	  907,  908,  910,  911,  912,  913,  914,  915,  917,  918,  919,
	  920,  921,  922,  923,  925,  926,  927,  928,  929,  930,  932,
	  933,  934,  935,  936,  937,  939,  940,  941,  942,  943,  944,
	  946,  947,  948,  949,  950,  951,  953,  954,  955,  956,  957,
	  958,  960,  961,  962,  963,  964,  965,  967,  968,  969,  970,
	  971,  972,  974,  975,  976,  977,  978,  979,  981,  982,  983,
	  984,  985,  987,  988,  989,  990,  991,  992,  994,  995,  996,
	  997,  998,  999,  1001, 1002, 1003, 1004, 1005, 1007, 1008, 1009,
	  1010, 1011, 1012, 1014, 1015, 1016, 1017, 1018, 1019, 1021, 1022,
	  1023 },
	{ 0,    0,    1,    1,    2,    3,    3,    4,    4,    5,    6,
	  6,    7,    8,    8,    9,    10,   10,   11,   12,   12,   13,
	  14,   15,   15,   16,   17,   17,   18,   19,   20,   20,   21,
	  22,   23,   23,   24,   25,   26,   26,   27,   28,   29,   29,
	  30,   31,   32,   32,   33,   34,   35,   36,   36,   37,   38,
	  39,   40,   40,   41,   42,   43,   43,   44,   45,   46,   47,
	  48,   48,   49,   50,   51,   52,   52,   53,   54,   55,   56,
	  56,   57,   58,   59,   60,   61,   61,   62,   63,   64,   65,
	  66,   66,   67,   68,   69,   70,   71,   71,   72,   73,   74,
	  75,   76,   76,   77,   78,   79,   80,   81,   82,   82,   83,
	  84,   85,   86,   87,   88,   88,   89,   90,   91,   92,   93,
	  94,   95,   95,   96,   97,   98,   99,   100,  101,  101,  102,
	  103,  104,  105,  106,  107,  108,  109,  109,  110,  111,  112,
	  113,  114,  115,  116,  116,  117,  118,  119,  120,  121,  122,
	  123,  124,  124,  125,  126,  127,  128,  129,  130,  131,  132,
	  133,  133,  134,  135,  136,  137,  138,  139,  140,  141,  142,
	  142,  143,  144,  145,  146,  147,  148,  149,  150,  151,  152,
	  153,  153,  154,  155,  156,  157,  158,  159,  160,  161,  162,
	  163,  164,  164,  165,  166,  167,  168,  169,  170,  171,  172,
	  173,  174,  175,  176,  176,  177,  178,  179,  180,  181,  182,
	  183,  184,  185,  186,  187,  188,  189,  189,  190,  191,  192,
	  193,  194,  195,  196,  197,  198,  199,  200,  201,  202,  203,
	  204,  205,  205,  206,  207,  208,  209,  210,  211,  212,  213,
	  214,  215,  216,  217,  218,  219,  220,  221,  222,  222,  223,
	  224,  225,  226,  227,  228,  229,  230,  231,  232,  233,  234,
	  235,  236,  237,  238,  239,  240,  241,  242,  243,  244,  244,
	  245,  246,  247,  248,  249,  250,  251,  252,  253,  254,  255,
	  256,  257,  258,  259,  260,  261,  262,  263,  264,  265,  266,
	  267,  268,  269,  270,  271,  272,  273,  273,  274,  275,  276,
	  277,  278,  279,  280,  281,  282,  283,  284,  285,  286,  287,
	  288,  289,  290,  291,  292,  293,  294,  295,  296,  297,  298,
	  299,  300,  301,  302,  303,  304,  305,  306,  307,  308,  309,
	  310,  311,  312,  313,  314,  315,  316,  317,  318,  319,  320,
	  321,  322,  323,  324,  325,  326,  327,  327,  328,  329,  330,
	  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,  341,
	  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
	  353,  354,  355,  356,  357,  358,  359,  360,  361,  362,  363,
	  364,  365,  366,  367,  368,  369,  370,  371,  372,  373,  374,
	  375,  376,  377,  378,  379,  380,  381,  382,  383,  384,  386,
	  387,  388,  389,  390,  391,  392,  393,  394,  395,  396,  397,
	  398,  399,  400,  401,  402,  403,  404,  405,  406,  407,  408,
	  409,  410,  411,  412,  413,  414,  415,  416,  417,  418,  419,
	  420,  421,  422,  423,  424,  425,  426,  427,  428,  429,  430,
	  431,  432,  433,  434,  435,  436,  437,  438,  439,  440,  441,
	  442,  443,  444,  445,  447,  448,  449,  450,  451,  452,  453,
	  454,  455,  456,  457,  458,  459,  460,  461,  462,  463,  464,
	  465,  466,  467,  468,  469,  470,  471,  472,  473,  474,  475,
	  476,  477,  478,  479,  480,  482,  483,  484,  485,  486,  487,
	  488,  489,  490,  491,  492,  493,  494,  495,  496,  497,  498,
	  499,  500,  501,  502,  503,  504,  505,  506,  507,  508,  509,
	  511,  512,  513,  514,  515,  516,  517,  518,  519,  520,  521,
	  522,  523,  524,  525,  526,  527,  528,  529,  530,  531,  532,
	  533,  535,  536,  537,  538,  539,  540,  541,  542,  543,  544,
	  545,  546,  547,  548,  549,  550,  551,  552,  553,  554,  555,
	  556,  558,  559,  560,  561,  562,  563,  564,  565,  566,  567,
	  568,  569,  570,  571,  572,  573,  574,  575,  576,  578,  579,
	  580,  581,  582,  583,  584,  585,  586,  587,  588,  589,  590,
	  591,  592,  593,  594,  595,  597,  598,  599,  600,  601,  602,
	  603,  604,  605,  606,  607,  608,  609,  610,  611,  612,  613,
	  615,  616,  617,  618,  619,  620,  621,  622,  623,  624,  625,
	  626,  627,  628,  629,  630,  632,  633,  634,  635,  636,  637,
	  638,  639,  640,  641,  642,  643,  644,  645,  646,  647,  649,
	  650,  651,  652,  653,  654,  655,  656,  657,  658,  659,  660,
	  661,  662,  663,  665,  666,  667,  668,  669,  670,  671,  672,
	  673,  674,  675,  676,  677,  678,  680,  681,  682,  683,  684,
	  685,  686,  687,  688,  689,  690,  691,  692,  694,  695,  696,
	  697,  698,  699,  700,  701,  702,  703,  704,  705,  706,  707,
	  709,  710,  711,  712,  713,  714,  715,  716,  717,  718,  719,
	  720,  721,  723,  724,  725,  726,  727,  728,  729,  730,  731,
	  732,  733,  734,  736,  737,  738,  739,  740,  741,  742,  743,
	  744,  745,  746,  747,  749,  750,  751,  752,  753,  754,  755,
	  756,  757,  758,  759,  760,  762,  763,  764,  765,  766,  767,
	  768,  769,  770,  771,  772,  773,  775,  776,  777,  778,  779,
	  780,  781,  782,  783,  784,  785,  787,  788,  789,  790,  791,
	  792,  793,  794,  795,  796,  797,  799,  800,  801,  802,  803,
	  804,  805,  806,  807,  808,  809,  811,  812,  813,  814,  815,
	  816,  817,  818,  819,  820,  821,  823,  824,  825,  826,  827,
	  828,  829,  830,  831,  832,  834,  835,  836,  837,  838,  839,
	  840,  841,  842,  843,  844,  846,  847,  848,  849,  850,  851,
	  852,  853,  854,  855,  857,  858,  859,  860,  861,  862,  863,
	  864,  865,  866,  868,  869,  870,  871,  872,  873,  874,  875,
	  876,  877,  879,  880,  881,  882,  883,  884,  885,  886,  887,
	  888,  890,  891,  892,  893,  894,  895,  896,  897,  898,  900,
	  901,  902,  903,  904,  905,  906,  907,  908,  909,  911,  912,
	  913,  914,  915,  916,  917,  918,  919,  921,  922,  923,  924,
	  925,  926,  927,  928,  929,  931,  932,  933,  934,  935,  936,
	  937,  938,  939,  940,  942,  943,  944,  945,  946,  947,  948,
	  949,  950,  952,  953,  954,  955,  956,  957,  958,  959,  960,
	  962,  963,  964,  965,  966,  967,  968,  969,  971,  972,  973,
	  974,  975,  976,  977,  978,  979,  981,  982,  983,  984,  985,
	  986,  987,  988,  989,  991,  992,  993,  994,  995,  996,  997,
	  998,  1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1010,
	  1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1021, 1022,
	  1023 },
	{ 0,    1,    1,    2,    3,    4,    4,    5,    6,    7,    8,
	  8,    9,    10,   11,   12,   12,   13,   14,   15,   16,   17,
	  17,   18,   19,   20,   21,   22,   23,   23,   24,   25,   26,
	  27,   28,   29,   29,   30,   31,   32,   33,   34,   35,   36,
	  36,   37,   38,   39,   40,   41,   42,   43,   43,   44,   45,
	  46,   47,   48,   49,   50,   51,   52,   52,   53,   54,   55,
	  56,   57,   58,   59,   60,   60,   61,   62,   63,   64,   65,
	  66,   67,   68,   69,   70,   70,   71,   72,   73,   74,   75,
	  76,   77,   78,   79,   80,   81,   81,   82,   83,   84,   85,
	  86,   87,   88,   89,   90,   91,   92,   93,   93,   94,   95,
	  96,   97,   98,   99,   100,  101,  102,  103,  104,  105,  106,
	  106,  107,  108,  109,  110,  111,  112,  113,  114,  115,  116,
	  117,  118,  119,  120,  120,  121,  122,  123,  124,  125,  126,
	  127,  128,  129,  130,  131,  132,  133,  134,  135,  136,  137,
	  137,  138,  139,  140,  141,  142,  143,  144,  145,  146,  147,
	  148,  149,  150,  151,  152,  153,  154,  155,  156,  156,  157,
	  158,  159,  160,  161,  162,  163,  164,  165,  166,  167,  168,
	  169,  170,  171,  172,  173,  174,  175,  176,  177,  178,  178,
	  179,  180,  181,  182,  183,  184,  185,  186,  187,  188,  189,
	  190,  191,  192,  193,  194,  195,  196,  197,  198,  199,  200,
	  201,  202,  203,  204,  204,  205,  206,  207,  208,  209,  210,
	  211,  212,  213,  214,  215,  216,  217,  218,  219,  220,  221,
	  222,  223,  224,  225,  226,  227,  228,  229,  230,  231,  232,
	  233,  234,  235,  236,  237,  238,  239,  239,  240,  241,  242,
	  243,  244,  245,  246,  247,  248,  249,  250,  251,  252,  253,
	  254,  255,  256,  257,  258,  259,  260,  261,  262,  263,  264,
	  265,  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,
	  276,  277,  278,  279,  280,  281,  282,  283,  284,  285,  286,
	  287,  288,  289,  290,  291,  292,  293,  294,  294,  295,  296,
	  297,  298,  299,  300,  301,  302,  303,  304,  305,  306,  307,
	  308,  309,  310,  311,  312,  313,  314,  315,  316,  317,  318,
	  319,  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,
	  330,  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,
	  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
	  352,  353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
	  363,  364,  365,  366,  367,  368,  369,  370,  371,  372,  373,
	  374,  375,  376,  377,  378,  379,  380,  381,  382,  383,  384,
	  385,  386,  387,  388,  389,  390,  391,  392,  393,  394,  395,
	  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,  406,
	  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,  417,
	  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,  428,
	  429,  430,  431,  432,  433,  434,  435,  436,  437,  438,  439,
	  440,  441,  443,  444,  445,  446,  447,  448,  449,  450,  451,
	  452,  453,  454,  455,  456,  457,  458,  459,  460,  461,  462,
	  463,  464,  465,  466,  467,  468,  469,  470,  471,  472,  473,
	  474,  475,  476,  477,  478,  479,  480,  481,  482,  483,  484,
	  485,  486,  487,  488,  489,  490,  491,  492,  493,  494,  495,
	  496,  497,  498,  499,  500,  501,  502,  503,  504,  505,  506,
	  507,  508,  509,  511,  512,  513,  514,  515,  516,  517,  518,
	  519,  520,  521,  522,  523,  524,  525,  526,  527,  528,  529,
	  530,  531,  532,  533,  534,  535,  536,  537,  538,  539,  540,
	  541,  542,  543,  544,  545,  546,  547,  548,  549,  550,  551,
	  552,  553,  554,  555,  556,  558,  559,  560,  561,  562,  563,
	  564,  565,  566,  567,  568,  569,  570,  571,  572,  573,  574,
	  575,  576,  577,  578,  579,  580,  581,  582,  583,  584,  585,
	  586,  587,  588,  589,  590,  591,  592,  593,  594,  595,  597,
	  598,  599,  600,  601,  602,  603,  604,  605,  606,  607,  608,
	  609,  610,  611,  612,  613,  614,  615,  616,  617,  618,  619,
	  620,  621,  622,  623,  624,  625,  626,  627,  628,  629,  630,
	  632,  633,  634,  635,  636,  637,  638,  639,  640,  641,  642,
	  643,  644,  645,  646,  647,  648,  649,  650,  651,  652,  653,
	  654,  655,  656,  657,  658,  659,  660,  661,  663,  664,  665,
	  666,  667,  668,  669,  670,  671,  672,  673,  674,  675,  676,
	  677,  678,  679,  680,  681,  682,  683,  684,  685,  686,  687,
	  688,  689,  690,  691,  693,  694,  695,  696,  697,  698,  699,
	  700,  701,  702,  703,  704,  705,  706,  707,  708,  709,  710,
	  711,  712,  713,  714,  715,  716,  717,  718,  720,  721,  722,
	  723,  724,  725,  726,  727,  728,  729,  730,  731,  732,  733,
	  734,  735,  736,  737,  738,  739,  740,  741,  742,  743,  744,
	  746,  747,  748,  749,  750,  751,  752,  753,  754,  755,  756,
	  757,  758,  759,  760,  761,  762,  763,  764,  765,  766,  767,
	  768,  769,  771,  772,  773,  774,  775,  776,  777,  778,  779,
	  780,  781,  782,  783,  784,  785,  786,  787,  788,  789,  790,
	  791,  792,  794,  795,  796,  797,  798,  799,  800,  801,  802,
	  803,  804,  805,  806,  807,  808,  809,  810,  811,  812,  813,
	  814,  815,  817,  818,  819,  820,  821,  822,  823,  824,  825,
	  826,  827,  828,  829,  830,  831,  832,  833,  834,  835,  836,
	  837,  839,  840,  841,  842,  843,  844,  845,  846,  847,  848,
	  849,  850,  851,  852,  853,  854,  855,  856,  857,  858,  859,
	  861,  862,  863,  864,  865,  866,  867,  868,  869,  870,  871,
	  872,  873,  874,  875,  876,  877,  878,  879,  880,  882,  883,
	  884,  885,  886,  887,  888,  889,  890,  891,  892,  893,  894,
	  895,  896,  897,  898,  899,  900,  902,  903,  904,  905,  906,
	  907,  908,  909,  910,  911,  912,  913,  914,  915,  916,  917,
	  918,  919,  920,  922,  923,  924,  925,  926,  927,  928,  929,
	  930,  931,  932,  933,  934,  935,  936,  937,  938,  939,  941,
	  942,  943,  944,  945,  946,  947,  948,  949,  950,  951,  952,
	  953,  954,  955,  956,  957,  958,  960,  961,  962,  963,  964,
	  965,  966,  967,  968,  969,  970,  971,  972,  973,  974,  975,
	  976,  977,  979,  980,  981,  982,  983,  984,  985,  986,  987,
	  988,  989,  990,  991,  992,  993,  994,  995,  997,  998,  999,
	  1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010,
	  1011, 1012, 1013, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022,
	  1023 },
	{ 0,    1,    2,    3,    4,    5,    6,    7,    8,    9,    10,
	  11,   12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
	  22,   23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
	  33,   34,   35,   36,   37,   38,   39,   40,   41,   42,   43,
	  44,   45,   46,   47,   48,   49,   50,   51,   52,   53,   54,
	  55,   56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
	  66,   67,   68,   69,   70,   71,   72,   73,   74,   75,   76,
	  77,   78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
	  88,   89,   90,   91,   92,   93,   94,   95,   96,   97,   98,
	  99,   100,  101,  102,  103,  104,  105,  106,  107,  108,  109,
	  110,  111,  112,  113,  114,  115,  116,  117,  118,  119,  120,
	  121,  122,  123,  124,  125,  126,  127,  128,  129,  130,  131,
	  132,  133,  134,  135,  136,  137,  138,  139,  140,  141,  142,
	  143,  144,  145,  146,  147,  148,  149,  150,  151,  152,  153,
	  154,  155,  156,  157,  158,  159,  160,  161,  162,  163,  164,
	  165,  166,  167,  168,  169,  170,  171,  172,  173,  174,  175,
	  176,  177,  178,  179,  180,  181,  182,  183,  184,  185,  186,
	  187,  188,  189,  190,  191,  192,  193,  194,  195,  196,  197,
	  198,  199,  200,  201,  202,  203,  204,  205,  206,  207,  208,
	  209,  210,  211,  212,  213,  214,  215,  216,  217,  218,  219,
	  220,  221,  222,  223,  224,  225,  226,  227,  228,  229,  230,
	  231,  232,  233,  234,  235,  236,  237,  238,  239,  240,  241,
	  242,  243,  244,  245,  246,  247,  248,  249,  250,  251,  252,
	  253,  254,  255,  256,  257,  258,  259,  260,  261,  262,  263,
	  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,  274,
	  275,  276,  277,  278,  279,  280,  281,  282,  283,  284,  285,
	  286,  287,  288,  289,  290,  291,  292,  293,  294,  295,  296,
	  297,  298,  299,  300,  301,  302,  303,  304,  305,  306,  307,
	  308,  309,  310,  311,  312,  313,  314,  315,  316,  317,  318,
	  319,  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,
	  330,  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,
	  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
	  352,  353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
	  363,  364,  365,  366,  367,  368,  369,  370,  371,  372,  373,
	  374,  375,  376,  377,  378,  379,  380,  381,  382,  383,  384,
	  385,  386,  387,  388,  389,  390,  391,  392,  393,  394,  395,
	  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,  406,
	  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,  417,
	  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,  428,
	  429,  430,  431,  432,  433,  434,  435,  436,  437,  438,  439,
	  440,  441,  442,  443,  444,  445,  446,  447,  448,  449,  450,
	  451,  452,  453,  454,  455,  456,  457,  458,  459,  460,  461,
	  462,  463,  464,  465,  466,  467,  468,  469,  470,  471,  472,
	  473,  474,  475,  476,  477,  478,  479,  480,  481,  482,  483,
	  484,  485,  486,  487,  488,  489,  490,  491,  492,  493,  494,
	  495,  496,  497,  498,  499,  500,  501,  502,  503,  504,  505,
	  506,  507,  508,  509,  510,  511,  512,  513,  514,  515,  516,
	  517,  518,  519,  520,  521,  522,  523,  524,  525,  526,  527,
	  528,  529,  530,  531,  532,  533,  534,  535,  536,  537,  538,
	  539,  540,  541,  542,  543,  544,  545,  546,  547,  548,  549,
	  550,  551,  552,  553,  554,  555,  556,  557,  558,  559,  560,
	  561,  562,  563,  564,  565,  566,  567,  568,  569,  570,  571,
	  572,  573,  574,  575,  576,  577,  578,  579,  580,  581,  582,
	  583,  584,  585,  586,  587,  588,  589,  590,  591,  592,  593,
	  594,  595,  596,  597,  598,  599,  600,  601,  602,  603,  604,
	  605,  606,  607,  608,  609,  610,  611,  612,  613,  614,  615,
	  616,  617,  618,  619,  620,  621,  622,  623,  624,  625,  626,
	  627,  628,  629,  630,  631,  632,  633,  634,  635,  636,  637,
	  638,  639,  640,  641,  642,  643,  644,  645,  646,  647,  648,
	  649,  650,  651,  652,  653,  654,  655,  656,  657,  658,  659,
	  660,  661,  662,  663,  664,  665,  666,  667,  668,  669,  670,
	  671,  672,  673,  674,  675,  676,  677,  678,  679,  680,  681,
	  682,  683,  684,  685,  686,  687,  688,  689,  690,  691,  692,
	  693,  694,  695,  696,  697,  698,  699,  700,  701,  702,  703,
	  704,  705,  706,  707,  708,  709,  710,  711,  712,  713,  714,
	  715,  716,  717,  718,  719,  720,  721,  722,  723,  724,  725,
	  726,  727,  728,  729,  730,  731,  732,  733,  734,  735,  736,
	  737,  738,  739,  740,  741,  742,  743,  744,  745,  746,  747,
	  748,  749,  750,  751,  752,  753,  754,  755,  756,  757,  758,
	  759,  760,  761,  762,  763,  764,  765,  766,  767,  768,  769,
	  770,  771,  772,  773,  774,  775,  776,  777,  778,  779,  780,
	  781,  782,  783,  784,  785,  786,  787,  788,  789,  790,  791,
	  792,  793,  794,  795,  796,  797,  798,  799,  800,  801,  802,
	  803,  804,  805,  806,  807,  808,  809,  810,  811,  812,  813,
	  814,  815,  816,  817,  818,  819,  820,  821,  822,  823,  824,
	  825,  826,  827,  828,  829,  830,  831,  832,  833,  834,  835,
	  836,  837,  838,  839,  840,  841,  842,  843,  844,  845,  846,
	  847,  848,  849,  850,  851,  852,  853,  854,  855,  856,  857,
	  858,  859,  860,  861,  862,  863,  864,  865,  866,  867,  868,
	  869,  870,  871,  872,  873,  874,  875,  876,  877,  878,  879,
	  880,  881,  882,  883,  884,  885,  886,  887,  888,  889,  890,
	  891,  892,  893,  894,  895,  896,  897,  898,  899,  900,  901,
	  902,  903,  904,  905,  906,  907,  908,  909,  910,  911,  912,
	  913,  914,  915,  916,  917,  918,  919,  920,  921,  922,  923,
	  924,  925,  926,  927,  928,  929,  930,  931,  932,  933,  934,
	  935,  936,  937,  938,  939,  940,  941,  942,  943,  944,  945,
	  946,  947,  948,  949,  950,  951,  952,  953,  954,  955,  956,
	  957,  958,  959,  960,  961,  962,  963,  964,  965,  966,  967,
	  968,  969,  970,  971,  972,  973,  974,  975,  976,  977,  978,
	  979,  980,  981,  982,  983,  984,  985,  986,  987,  988,  989,
	  990,  991,  992,  993,  994,  995,  996,  997,  998,  999,  1000,
	  1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011,
	  1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022,
	  1023 },
	{ 0,    1,    3,    4,    5,    7,    8,    9,    11,   12,   13,
	  14,   15,   17,   18,   19,   20,   21,   23,   24,   25,   26,
	  27,   29,   30,   31,   32,   33,   34,   35,   37,   38,   39,
	  40,   41,   42,   44,   45,   46,   47,   48,   49,   50,   51,
	  53,   54,   55,   56,   57,   58,   59,   60,   62,   63,   64,
	  65,   66,   67,   68,   69,   70,   72,   73,   74,   75,   76,
	  77,   78,   79,   80,   81,   83,   84,   85,   86,   87,   88,
	  89,   90,   91,   92,   94,   95,   96,   97,   98,   99,   100,
	  101,  102,  103,  104,  105,  107,  108,  109,  110,  111,  112,
	  113,  114,  115,  116,  117,  118,  119,  121,  122,  123,  124,
	  125,  126,  127,  128,  129,  130,  131,  132,  133,  134,  135,
	  137,  138,  139,  140,  141,  142,  143,  144,  145,  146,  147,
	  148,  149,  150,  151,  152,  154,  155,  156,  157,  158,  159,
	  160,  161,  162,  163,  164,  165,  166,  167,  168,  169,  170,
	  171,  172,  174,  175,  176,  177,  178,  179,  180,  181,  182,
	  183,  184,  185,  186,  187,  188,  189,  190,  191,  192,  193,
	  194,  195,  197,  198,  199,  200,  201,  202,  203,  204,  205,
	  206,  207,  208,  209,  210,  211,  212,  213,  214,  215,  216,
	  217,  218,  219,  220,  221,  222,  223,  225,  226,  227,  228,
	  229,  230,  231,  232,  233,  234,  235,  236,  237,  238,  239,
	  240,  241,  242,  243,  244,  245,  246,  247,  248,  249,  250,
	  251,  252,  253,  254,  255,  256,  257,  258,  260,  261,  262,
	  263,  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,
	  274,  275,  276,  277,  278,  279,  280,  281,  282,  283,  284,
	  285,  286,  287,  288,  289,  290,  291,  292,  293,  294,  295,
	  296,  297,  298,  299,  300,  301,  302,  303,  304,  305,  306,
	  307,  308,  309,  310,  311,  312,  313,  314,  316,  317,  318,
	  319,  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,
	  330,  331,  332,  333,  334,  335,  336,  337,  338,  339,  340,
	  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
	  352,  353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
	  363,  364,  365,  366,  367,  368,  369,  370,  371,  372,  373,
	  374,  375,  376,  377,  378,  379,  380,  381,  382,  383,  384,
	  385,  386,  387,  388,  389,  390,  391,  392,  393,  394,  395,
	  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,  406,
	  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,  417,
	  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,  428,
	  429,  430,  431,  432,  433,  434,  435,  436,  437,  438,  439,
	  440,  441,  442,  443,  444,  445,  446,  447,  448,  449,  450,
	  451,  452,  453,  454,  455,  456,  457,  458,  459,  460,  461,
	  462,  463,  464,  464,  465,  466,  467,  468,  469,  470,  471,
	  472,  473,  474,  475,  476,  477,  478,  479,  480,  481,  482,
	  483,  484,  485,  486,  487,  488,  489,  490,  491,  492,  493,
	  494,  495,  496,  497,  498,  499,  500,  501,  502,  503,  504,
	  505,  506,  507,  508,  509,  510,  511,  512,  513,  514,  515,
	  516,  517,  518,  519,  520,  521,  522,  523,  524,  525,  526,
	  527,  528,  529,  530,  530,  531,  532,  533,  534,  535,  536,
	  537,  538,  539,  540,  541,  542,  543,  544,  545,  546,  547,
	  548,  549,  550,  551,  552,  553,  554,  555,  556,  557,  558,
	  559,  560,  561,  562,  563,  564,  565,  566,  567,  568,  569,
	  570,  571,  572,  573,  574,  575,  576,  577,  577,  578,  579,
	  580,  581,  582,  583,  584,  585,  586,  587,  588,  589,  590,
	  591,  592,  593,  594,  595,  596,  597,  598,  599,  600,  601,
	  602,  603,  604,  605,  606,  607,  608,  609,  610,  611,  612,
	  613,  614,  615,  615,  616,  617,  618,  619,  620,  621,  622,
	  623,  624,  625,  626,  627,  628,  629,  630,  631,  632,  633,
	  634,  635,  636,  637,  638,  639,  640,  641,  642,  643,  644,
	  645,  646,  647,  648,  648,  649,  650,  651,  652,  653,  654,
	  655,  656,  657,  658,  659,  660,  661,  662,  663,  664,  665,
	  666,  667,  668,  669,  670,  671,  672,  673,  674,  675,  676,
	  677,  678,  679,  679,  680,  681,  682,  683,  684,  685,  686,
	  687,  688,  689,  690,  691,  692,  693,  694,  695,  696,  697,
	  698,  699,  700,  701,  702,  703,  704,  705,  706,  707,  707,
	  708,  709,  710,  711,  712,  713,  714,  715,  716,  717,  718,
	  719,  720,  721,  722,  723,  724,  725,  726,  727,  728,  729,
	  730,  731,  732,  733,  733,  734,  735,  736,  737,  738,  739,
	  740,  741,  742,  743,  744,  745,  746,  747,  748,  749,  750,
	  751,  752,  753,  754,  755,  756,  757,  758,  758,  759,  760,
	  761,  762,  763,  764,  765,  766,  767,  768,  769,  770,  771,
	  772,  773,  774,  775,  776,  777,  778,  779,  780,  781,  782,
	  782,  783,  784,  785,  786,  787,  788,  789,  790,  791,  792,
	  793,  794,  795,  796,  797,  798,  799,  800,  801,  802,  803,
	  804,  805,  805,  806,  807,  808,  809,  810,  811,  812,  813,
	  814,  815,  816,  817,  818,  819,  820,  821,  822,  823,  824,
	  825,  826,  827,  827,  828,  829,  830,  831,  832,  833,  834,
	  835,  836,  837,  838,  839,  840,  841,  842,  843,  844,  845,
	  846,  847,  848,  848,  849,  850,  851,  852,  853,  854,  855,
	  856,  857,  858,  859,  860,  861,  862,  863,  864,  865,  866,
	  867,  868,  868,  869,  870,  871,  872,  873,  874,  875,  876,
	  877,  878,  879,  880,  881,  882,  883,  884,  885,  886,  887,
	  888,  888,  889,  890,  891,  892,  893,  894,  895,  896,  897,
	  898,  899,  900,  901,  902,  903,  904,  905,  906,  907,  907,
	  908,  909,  910,  911,  912,  913,  914,  915,  916,  917,  918,
	  919,  920,  921,  922,  923,  924,  925,  926,  926,  927,  928,
	  929,  930,  931,  932,  933,  934,  935,  936,  937,  938,  939,
	  940,  941,  942,  943,  944,  945,  945,  946,  947,  948,  949,
	  950,  951,  952,  953,  954,  955,  956,  957,  958,  959,  960,
	  961,  962,  963,  963,  964,  965,  966,  967,  968,  969,  970,
	  971,  972,  973,  974,  975,  976,  977,  978,  979,  980,  980,
	  981,  982,  983,  984,  985,  986,  987,  988,  989,  990,  991,
	  992,  993,  994,  995,  996,  997,  998,  998,  999,  1000, 1001,
	  1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012,
	  1013, 1014, 1015, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022,
	  1023 },
	{ 0,    2,    4,    6,    7,    9,    10,   12,   13,   15,   16,
	  18,   19,   21,   22,   24,   25,   26,   28,   29,   30,   32,
	  33,   35,   36,   37,   39,   40,   41,   42,   44,   45,   46,
	  48,   49,   50,   52,   53,   54,   55,   57,   58,   59,   60,
	  62,   63,   64,   65,   67,   68,   69,   70,   72,   73,   74,
	  75,   76,   78,   79,   80,   81,   83,   84,   85,   86,   87,
	  89,   90,   91,   92,   93,   94,   96,   97,   98,   99,   100,
	  102,  103,  104,  105,  106,  107,  109,  110,  111,  112,  113,
	  114,  116,  117,  118,  119,  120,  121,  123,  124,  125,  126,
	  127,  128,  129,  131,  132,  133,  134,  135,  136,  137,  139,
	  140,  141,  142,  143,  144,  145,  146,  148,  149,  150,  151,
	  152,  153,  154,  155,  157,  158,  159,  160,  161,  162,  163,
	  164,  165,  167,  168,  169,  170,  171,  172,  173,  174,  175,
	  177,  178,  179,  180,  181,  182,  183,  184,  185,  186,  188,
	  189,  190,  191,  192,  193,  194,  195,  196,  197,  198,  200,
	  201,  202,  203,  204,  205,  206,  207,  208,  209,  210,  211,
	  213,  214,  215,  216,  217,  218,  219,  220,  221,  222,  223,
	  224,  225,  226,  228,  229,  230,  231,  232,  233,  234,  235,
	  236,  237,  238,  239,  240,  241,  242,  244,  245,  246,  247,
	  248,  249,  250,  251,  252,  253,  254,  255,  256,  257,  258,
	  259,  260,  261,  263,  264,  265,  266,  267,  268,  269,  270,
	  271,  272,  273,  274,  275,  276,  277,  278,  279,  280,  281,
	  282,  283,  285,  286,  287,  288,  289,  290,  291,  292,  293,
	  294,  295,  296,  297,  298,  299,  300,  301,  302,  303,  304,
	  305,  306,  307,  308,  309,  310,  311,  312,  313,  315,  316,
	  317,  318,  319,  320,  321,  322,  323,  324,  325,  326,  327,
	  328,  329,  330,  331,  332,  333,  334,  335,  336,  337,  338,
	  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
	  350,  351,  352,  353,  354,  355,  356,  357,  358,  359,  360,
	  361,  362,  363,  364,  365,  366,  367,  368,  370,  371,  372,
	  373,  374,  375,  376,  377,  378,  379,  380,  381,  382,  383,
	  384,  385,  386,  387,  388,  389,  390,  391,  392,  393,  394,
	  395,  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,
	  406,  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,
	  417,  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,
	  427,  428,  429,  430,  431,  432,  433,  434,  435,  436,  437,
	  438,  439,  440,  441,  442,  443,  444,  445,  446,  447,  448,
	  449,  450,  451,  452,  453,  454,  455,  456,  457,  458,  459,
	  460,  461,  462,  463,  464,  465,  466,  467,  468,  469,  470,
	  471,  472,  473,  474,  475,  476,  477,  478,  479,  480,  481,
	  482,  483,  484,  485,  486,  487,  487,  488,  489,  490,  491,
	  492,  493,  494,  495,  496,  497,  498,  499,  500,  501,  502,
	  503,  504,  505,  506,  507,  508,  509,  510,  511,  512,  513,
	  514,  515,  516,  517,  518,  519,  520,  521,  522,  522,  523,
	  524,  525,  526,  527,  528,  529,  530,  531,  532,  533,  534,
	  535,  536,  537,  538,  539,  540,  541,  542,  543,  544,  545,
	  546,  547,  548,  549,  549,  550,  551,  552,  553,  554,  555,
	  556,  557,  558,  559,  560,  561,  562,  563,  564,  565,  566,
	  567,  568,  569,  570,  571,  572,  573,  573,  574,  575,  576,
	  577,  578,  579,  580,  581,  582,  583,  584,  585,  586,  587,
	  588,  589,  590,  591,  592,  593,  594,  594,  595,  596,  597,
	  598,  599,  600,  601,  602,  603,  604,  605,  606,  607,  608,
	  609,  610,  611,  612,  613,  614,  614,  615,  616,  617,  618,
	  619,  620,  621,  622,  623,  624,  625,  626,  627,  628,  629,
	  630,  631,  632,  632,  633,  634,  635,  636,  637,  638,  639,
	  640,  641,  642,  643,  644,  645,  646,  647,  648,  649,  649,
	  650,  651,  652,  653,  654,  655,  656,  657,  658,  659,  660,
	  661,  662,  663,  664,  665,  665,  666,  667,  668,  669,  670,
	  671,  672,  673,  674,  675,  676,  677,  678,  679,  680,  680,
	  681,  682,  683,  684,  685,  686,  687,  688,  689,  690,  691,
	  692,  693,  694,  695,  695,  696,  697,  698,  699,  700,  701,
	  702,  703,  704,  705,  706,  707,  708,  709,  709,  710,  711,
	  712,  713,  714,  715,  716,  717,  718,  719,  720,  721,  722,
	  723,  723,  724,  725,  726,  727,  728,  729,  730,  731,  732,
	  733,  734,  735,  736,  736,  737,  738,  739,  740,  741,  742,
	  743,  744,  745,  746,  747,  748,  749,  749,  750,  751,  752,
	  753,  754,  755,  756,  757,  758,  759,  760,  761,  762,  762,
	  763,  764,  765,  766,  767,  768,  769,  770,  771,  772,  773,
	  774,  774,  775,  776,  777,  778,  779,  780,  781,  782,  783,
	  784,  785,  786,  786,  787,  788,  789,  790,  791,  792,  793,
	  794,  795,  796,  797,  797,  798,  799,  800,  801,  802,  803,
	  804,  805,  806,  807,  808,  809,  809,  810,  811,  812,  813,
	  814,  815,  816,  817,  818,  819,  820,  820,  821,  822,  823,
	  824,  825,  826,  827,  828,  829,  830,  831,  831,  832,  833,
	  834,  835,  836,  837,  838,  839,  840,  841,  841,  842,  843,
	  844,  845,  846,  847,  848,  849,  850,  851,  852,  852,  853,
	  854,  855,  856,  857,  858,  859,  860,  861,  862,  862,  863,
	  864,  865,  866,  867,  868,  869,  870,  871,  872,  873,  873,
	  874,  875,  876,  877,  878,  879,  880,  881,  882,  883,  883,
	  884,  885,  886,  887,  888,  889,  890,  891,  892,  892,  893,
	  894,  895,  896,  897,  898,  899,  900,  901,  902,  902,  903,
	  904,  905,  906,  907,  908,  909,  910,  911,  912,  912,  913,
	  914,  915,  916,  917,  918,  919,  920,  921,  921,  922,  923,
	  924,  925,  926,  927,  928,  929,  930,  931,  931,  932,  933,
	  934,  935,  936,  937,  938,  939,  940,  940,  941,  942,  943,
	  944,  945,  946,  947,  948,  949,  949,  950,  951,  952,  953,
	  954,  955,  956,  957,  958,  958,  959,  960,  961,  962,  963,
	  964,  965,  966,  967,  967,  968,  969,  970,  971,  972,  973,
	  974,  975,  976,  976,  977,  978,  979,  980,  981,  982,  983,
	  984,  985,  985,  986,  987,  988,  989,  990,  991,  992,  993,
	  993,  994,  995,  996,  997,  998,  999,  1000, 1001, 1002, 1002,
	  1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1010, 1011, 1012,
	  1013, 1014, 1015, 1016, 1017, 1018, 1019, 1019, 1020, 1021, 1022,
	  1023 },
	{ 0,    3,    5,    7,    9,    11,   13,   15,   17,   19,   20,
	  22,   24,   25,   27,   29,   30,   32,   33,   35,   36,   38,
	  40,   41,   43,   44,   46,   47,   48,   50,   51,   53,   54,
	  56,   57,   59,   60,   61,   63,   64,   66,   67,   68,   70,
	  71,   72,   74,   75,   77,   78,   79,   81,   82,   83,   85,
	  86,   87,   89,   90,   91,   92,   94,   95,   96,   98,   99,
	  100,  102,  103,  104,  105,  107,  108,  109,  110,  112,  113,
	  114,  116,  117,  118,  119,  121,  122,  123,  124,  125,  127,
	  128,  129,  130,  132,  133,  134,  135,  137,  138,  139,  140,
	  141,  143,  144,  145,  146,  147,  149,  150,  151,  152,  153,
	  155,  156,  157,  158,  159,  161,  162,  163,  164,  165,  166,
	  168,  169,  170,  171,  172,  173,  175,  176,  177,  178,  179,
	  180,  182,  183,  184,  185,  186,  187,  188,  190,  191,  192,
	  193,  194,  195,  196,  198,  199,  200,  201,  202,  203,  204,
	  206,  207,  208,  209,  210,  211,  212,  213,  215,  216,  217,
	  218,  219,  220,  221,  222,  224,  225,  226,  227,  228,  229,
	  230,  231,  232,  234,  235,  236,  237,  238,  239,  240,  241,
	  242,  243,  245,  246,  247,  248,  249,  250,  251,  252,  253,
	  254,  255,  257,  258,  259,  260,  261,  262,  263,  264,  265,
	  266,  267,  268,  270,  271,  272,  273,  274,  275,  276,  277,
	  278,  279,  280,  281,  282,  283,  285,  286,  287,  288,  289,
	  290,  291,  292,  293,  294,  295,  296,  297,  298,  299,  300,
	  302,  303,  304,  305,  306,  307,  308,  309,  310,  311,  312,
	  313,  314,  315,  316,  317,  318,  319,  320,  321,  323,  324,
	  325,  326,  327,  328,  329,  330,  331,  332,  333,  334,  335,
	  336,  337,  338,  339,  340,  341,  342,  343,  344,  345,  346,
	  347,  348,  349,  350,  351,  353,  354,  355,  356,  357,  358,
	  359,  360,  361,  362,  363,  364,  365,  366,  367,  368,  369,
	  370,  371,  372,  373,  374,  375,  376,  377,  378,  379,  380,
	  381,  382,  383,  384,  385,  386,  387,  388,  389,  390,  391,
	  392,  393,  394,  395,  396,  397,  398,  399,  400,  401,  402,
	  403,  404,  405,  406,  407,  408,  409,  410,  411,  412,  413,
	  414,  415,  416,  417,  418,  419,  420,  421,  422,  423,  424,
	  425,  426,  427,  428,  429,  430,  431,  432,  433,  434,  435,
	  436,  437,  438,  439,  440,  441,  442,  443,  444,  445,  446,
	  447,  448,  449,  450,  451,  452,  453,  454,  455,  456,  457,
	  458,  459,  460,  461,  462,  463,  464,  465,  466,  466,  467,
	  468,  469,  470,  471,  472,  473,  474,  475,  476,  477,  478,
	  479,  480,  481,  482,  483,  484,  485,  486,  487,  488,  489,
	  490,  491,  492,  493,  494,  495,  496,  497,  498,  499,  499,
	  500,  501,  502,  503,  504,  505,  506,  507,  508,  509,  510,
	  511,  512,  513,  514,  515,  516,  517,  518,  519,  520,  521,
	  522,  523,  523,  524,  525,  526,  527,  528,  529,  530,  531,
	  532,  533,  534,  535,  536,  537,  538,  539,  540,  541,  542,
	  543,  543,  544,  545,  546,  547,  548,  549,  550,  551,  552,
	  553,  554,  555,  556,  557,  558,  559,  560,  561,  561,  562,
	  563,  564,  565,  566,  567,  568,  569,  570,  571,  572,  573,
	  574,  575,  576,  577,  577,  578,  579,  580,  581,  582,  583,
	  584,  585,  586,  587,  588,  589,  590,  591,  592,  592,  593,
	  594,  595,  596,  597,  598,  599,  600,  601,  602,  603,  604,
	  605,  606,  606,  607,  608,  609,  610,  611,  612,  613,  614,
	  615,  616,  617,  618,  619,  619,  620,  621,  622,  623,  624,
	  625,  626,  627,  628,  629,  630,  631,  632,  632,  633,  634,
	  635,  636,  637,  638,  639,  640,  641,  642,  643,  644,  644,
	  645,  646,  647,  648,  649,  650,  651,  652,  653,  654,  655,
	  655,  656,  657,  658,  659,  660,  661,  662,  663,  664,  665,
	  666,  666,  667,  668,  669,  670,  671,  672,  673,  674,  675,
	  676,  677,  677,  678,  679,  680,  681,  682,  683,  684,  685,
	  686,  687,  687,  688,  689,  690,  691,  692,  693,  694,  695,
	  696,  697,  697,  698,  699,  700,  701,  702,  703,  704,  705,
	  706,  707,  707,  708,  709,  710,  711,  712,  713,  714,  715,
	  716,  716,  717,  718,  719,  720,  721,  722,  723,  724,  725,
	  726,  726,  727,  728,  729,  730,  731,  732,  733,  734,  735,
	  735,  736,  737,  738,  739,  740,  741,  742,  743,  744,  744,
	  745,  746,  747,  748,  749,  750,  751,  752,  752,  753,  754,
	  755,  756,  757,  758,  759,  760,  761,  761,  762,  763,  764,
	  765,  766,  767,  768,  769,  769,  770,  771,  772,  773,  774,
	  775,  776,  777,  777,  778,  779,  780,  781,  782,  783,  784,
	  785,  785,  786,  787,  788,  789,  790,  791,  792,  793,  793,
	  794,  795,  796,  797,  798,  799,  800,  801,  801,  802,  803,
	  804,  805,  806,  807,  808,  809,  809,  810,  811,  812,  813,
	  814,  815,  816,  816,  817,  818,  819,  820,  821,  822,  823,
	  824,  824,  825,  826,  827,  828,  829,  830,  831,  831,  832,
	  833,  834,  835,  836,  837,  838,  838,  839,  840,  841,  842,
	  843,  844,  845,  846,  846,  847,  848,  849,  850,  851,  852,
	  853,  853,  854,  855,  856,  857,  858,  859,  860,  860,  861,
	  862,  863,  864,  865,  866,  867,  867,  868,  869,  870,  871,
	  872,  873,  873,  874,  875,  876,  877,  878,  879,  880,  880,
	  881,  882,  883,  884,  885,  886,  887,  887,  888,  889,  890,
	  891,  892,  893,  894,  894,  895,  896,  897,  898,  899,  900,
	  900,  901,  902,  903,  904,  905,  906,  907,  907,  908,  909,
	  910,  911,  912,  913,  913,  914,  915,  916,  917,  918,  919,
	  919,  920,  921,  922,  923,  924,  925,  926,  926,  927,  928,
	  929,  930,  931,  932,  932,  933,  934,  935,  936,  937,  938,
	  938,  939,  940,  941,  942,  943,  944,  944,  945,  946,  947,
	  948,  949,  950,  950,  951,  952,  953,  954,  955,  956,  957,
	  957,  958,  959,  960,  961,  962,  963,  963,  964,  965,  966,
	  967,  968,  968,  969,  970,  971,  972,  973,  974,  974,  975,
	  976,  977,  978,  979,  980,  980,  981,  982,  983,  984,  985,
	  986,  986,  987,  988,  989,  990,  991,  992,  992,  993,  994,
	  995,  996,  997,  998,  998,  999,  1000, 1001, 1002, 1003, 1003,
	  1004, 1005, 1006, 1007, 1008, 1009, 1009, 1010, 1011, 1012, 1013,
	  1014, 1015, 1015, 1016, 1017, 1018, 1019, 1020, 1020, 1021, 1022,
	  1023 },
	{ 0,    4,    7,    9,    12,   14,   16,   18,   20,   22,   24,
	  26,   28,   30,   32,   34,   36,   38,   39,   41,   43,   45,
	  46,   48,   50,   51,   53,   55,   56,   58,   59,   61,   63,
	  64,   66,   67,   69,   70,   72,   73,   75,   76,   78,   79,
	  81,   82,   84,   85,   87,   88,   90,   91,   93,   94,   95,
	  97,   98,   100,  101,  102,  104,  105,  107,  108,  109,  111,
	  112,  114,  115,  116,  118,  119,  120,  122,  123,  124,  126,
	  127,  128,  130,  131,  132,  134,  135,  136,  138,  139,  140,
	  141,  143,  144,  145,  147,  148,  149,  150,  152,  153,  154,
	  156,  157,  158,  159,  161,  162,  163,  164,  166,  167,  168,
	  169,  171,  172,  173,  174,  176,  177,  178,  179,  180,  182,
	  183,  184,  185,  187,  188,  189,  190,  191,  193,  194,  195,
	  196,  197,  199,  200,  201,  202,  203,  205,  206,  207,  208,
	  209,  210,  212,  213,  214,  215,  216,  218,  219,  220,  221,
	  222,  223,  224,  226,  227,  228,  229,  230,  231,  233,  234,
	  235,  236,  237,  238,  239,  241,  242,  243,  244,  245,  246,
	  247,  249,  250,  251,  252,  253,  254,  255,  256,  258,  259,
	  260,  261,  262,  263,  264,  265,  267,  268,  269,  270,  271,
	  272,  273,  274,  275,  277,  278,  279,  280,  281,  282,  283,
	  284,  285,  286,  287,  289,  290,  291,  292,  293,  294,  295,
	  296,  297,  298,  299,  301,  302,  303,  304,  305,  306,  307,
	  308,  309,  310,  311,  312,  313,  315,  316,  317,  318,  319,
	  320,  321,  322,  323,  324,  325,  326,  327,  328,  329,  330,
	  332,  333,  334,  335,  336,  337,  338,  339,  340,  341,  342,
	  343,  344,  345,  346,  347,  348,  349,  350,  351,  353,  354,
	  355,  356,  357,  358,  359,  360,  361,  362,  363,  364,  365,
	  366,  367,  368,  369,  370,  371,  372,  373,  374,  375,  376,
	  377,  378,  379,  380,  381,  382,  383,  384,  385,  387,  388,
	  389,  390,  391,  392,  393,  394,  395,  396,  397,  398,  399,
	  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,  410,
	  411,  412,  413,  414,  415,  416,  417,  418,  419,  420,  421,
	  422,  423,  424,  425,  426,  427,  428,  429,  430,  431,  432,
	  433,  434,  435,  436,  437,  438,  439,  440,  441,  442,  443,
	  444,  445,  446,  447,  448,  449,  450,  450,  451,  452,  453,
	  454,  455,  456,  457,  458,  459,  460,  461,  462,  463,  464,
	  465,  466,  467,  468,  469,  470,  471,  472,  473,  474,  475,
	  476,  477,  478,  479,  480,  481,  482,  483,  484,  485,  486,
	  486,  487,  488,  489,  490,  491,  492,  493,  494,  495,  496,
	  497,  498,  499,  500,  501,  502,  503,  504,  505,  506,  507,
	  508,  509,  509,  510,  511,  512,  513,  514,  515,  516,  517,
	  518,  519,  520,  521,  522,  523,  524,  525,  526,  527,  528,
	  528,  529,  530,  531,  532,  533,  534,  535,  536,  537,  538,
	  539,  540,  541,  542,  543,  544,  544,  545,  546,  547,  548,
	  549,  550,  551,  552,  553,  554,  555,  556,  557,  558,  559,
	  559,  560,  561,  562,  563,  564,  565,  566,  567,  568,  569,
	  570,  571,  572,  572,  573,  574,  575,  576,  577,  578,  579,
	  580,  581,  582,  583,  584,  584,  585,  586,  587,  588,  589,
	  590,  591,  592,  593,  594,  595,  596,  596,  597,  598,  599,
	  600,  601,  602,  603,  604,  605,  606,  607,  607,  608,  609,
	  610,  611,  612,  613,  614,  615,  616,  617,  617,  618,  619,
	  620,  621,  622,  623,  624,  625,  626,  627,  627,  628,  629,
	  630,  631,  632,  633,  634,  635,  636,  637,  637,  638,  639,
	  640,  641,  642,  643,  644,  645,  646,  646,  647,  648,  649,
	  650,  651,  652,  653,  654,  655,  655,  656,  657,  658,  659,
	  660,  661,  662,  663,  663,  664,  665,  666,  667,  668,  669,
	  670,  671,  672,  672,  673,  674,  675,  676,  677,  678,  679,
	  680,  680,  681,  682,  683,  684,  685,  686,  687,  688,  688,
	  689,  690,  691,  692,  693,  694,  695,  696,  696,  697,  698,
	  699,  700,  701,  702,  703,  703,  704,  705,  706,  707,  708,
	  709,  710,  711,  711,  712,  713,  714,  715,  716,  717,  718,
	  718,  719,  720,  721,  722,  723,  724,  725,  725,  726,  727,
	  728,  729,  730,  731,  732,  732,  733,  734,  735,  736,  737,
	  738,  739,  739,  740,  741,  742,  743,  744,  745,  746,  746,
	  747,  748,  749,  750,  751,  752,  752,  753,  754,  755,  756,
	  757,  758,  759,  759,  760,  761,  762,  763,  764,  765,  765,
	  766,  767,  768,  769,  770,  771,  772,  772,  773,  774,  775,
	  776,  777,  778,  778,  779,  780,  781,  782,  783,  784,  784,
	  785,  786,  787,  788,  789,  790,  790,  791,  792,  793,  794,
	  795,  796,  796,  797,  798,  799,  800,  801,  802,  802,  803,
	  804,  805,  806,  807,  808,  808,  809,  810,  811,  812,  813,
	  814,  814,  815,  816,  817,  818,  819,  819,  820,  821,  822,
	  823,  824,  825,  825,  826,  827,  828,  829,  830,  831,  831,
	  832,  833,  834,  835,  836,  836,  837,  838,  839,  840,  841,
	  842,  842,  843,  844,  845,  846,  847,  847,  848,  849,  850,
	  851,  852,  852,  853,  854,  855,  856,  857,  858,  858,  859,
	  860,  861,  862,  863,  863,  864,  865,  866,  867,  868,  868,
	  869,  870,  871,  872,  873,  874,  874,  875,  876,  877,  878,
	  879,  879,  880,  881,  882,  883,  884,  884,  885,  886,  887,
	  888,  889,  889,  890,  891,  892,  893,  894,  894,  895,  896,
	  897,  898,  899,  899,  900,  901,  902,  903,  904,  904,  905,
	  906,  907,  908,  909,  909,  910,  911,  912,  913,  913,  914,
	  915,  916,  917,  918,  918,  919,  920,  921,  922,  923,  923,
	  924,  925,  926,  927,  928,  928,  929,  930,  931,  932,  933,
	  933,  934,  935,  936,  937,  937,  938,  939,  940,  941,  942,
	  942,  943,  944,  945,  946,  946,  947,  948,  949,  950,  951,
	  951,  952,  953,  954,  955,  956,  956,  957,  958,  959,  960,
	  960,  961,  962,  963,  964,  965,  965,  966,  967,  968,  969,
	  969,  970,  971,  972,  973,  974,  974,  975,  976,  977,  978,
	  978,  979,  980,  981,  982,  982,  983,  984,  985,  986,  987,
	  987,  988,  989,  990,  991,  991,  992,  993,  994,  995,  995,
	  996,  997,  998,  999,  1000, 1000, 1001, 1002, 1003, 1004, 1004,
	  1005, 1006, 1007, 1008, 1008, 1009, 1010, 1011, 1012, 1013, 1013,
	  1014, 1015, 1016, 1017, 1017, 1018, 1019, 1020, 1021, 1021, 1022,
	  1023 },
	{ 0,    5,    8,    12,   14,   17,   20,   22,   25,   27,   29,
	  31,   33,   36,   38,   40,   42,   44,   46,   48,   50,   51,
	  53,   55,   57,   59,   61,   62,   64,   66,   68,   69,   71,
	  73,   75,   76,   78,   80,   81,   83,   85,   86,   88,   89,
	  91,   93,   94,   96,   97,   99,   100,  102,  103,  105,  106,
	  108,  109,  111,  112,  114,  115,  117,  118,  120,  121,  123,
	  124,  126,  127,  129,  130,  131,  133,  134,  136,  137,  138,
	  140,  141,  143,  144,  145,  147,  148,  150,  151,  152,  154,
	  155,  156,  158,  159,  160,  162,  163,  164,  166,  167,  168,
	  170,  171,  172,  174,  175,  176,  178,  179,  180,  181,  183,
	  184,  185,  187,  188,  189,  190,  192,  193,  194,  196,  197,
	  198,  199,  201,  202,  203,  204,  206,  207,  208,  209,  211,
	  212,  213,  214,  215,  217,  218,  219,  220,  222,  223,  224,
	  225,  226,  228,  229,  230,  231,  232,  234,  235,  236,  237,
	  238,  240,  241,  242,  243,  244,  246,  247,  248,  249,  250,
	  251,  253,  254,  255,  256,  257,  258,  260,  261,  262,  263,
	  264,  265,  266,  268,  269,  270,  271,  272,  273,  275,  276,
	  277,  278,  279,  280,  281,  282,  284,  285,  286,  287,  288,
	  289,  290,  291,  293,  294,  295,  296,  297,  298,  299,  300,
	  302,  303,  304,  305,  306,  307,  308,  309,  310,  311,  313,
	  314,  315,  316,  317,  318,  319,  320,  321,  322,  323,  325,
	  326,  327,  328,  329,  330,  331,  332,  333,  334,  335,  336,
	  338,  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
	  349,  350,  351,  352,  353,  355,  356,  357,  358,  359,  360,
	  361,  362,  363,  364,  365,  366,  367,  368,  369,  370,  371,
	  372,  373,  374,  376,  377,  378,  379,  380,  381,  382,  383,
	  384,  385,  386,  387,  388,  389,  390,  391,  392,  393,  394,
	  395,  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,
	  406,  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,
	  417,  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,
	  428,  429,  430,  431,  432,  433,  434,  435,  436,  437,  438,
	  439,  440,  441,  442,  443,  444,  445,  446,  447,  448,  449,
	  450,  451,  452,  453,  454,  455,  456,  457,  458,  459,  460,
	  461,  462,  463,  464,  465,  466,  467,  468,  469,  470,  471,
	  472,  473,  474,  475,  476,  477,  478,  479,  480,  480,  481,
	  482,  483,  484,  485,  486,  487,  488,  489,  490,  491,  492,
	  493,  494,  495,  496,  497,  498,  499,  500,  501,  502,  503,
	  503,  504,  505,  506,  507,  508,  509,  510,  511,  512,  513,
	  514,  515,  516,  517,  518,  519,  520,  521,  521,  522,  523,
	  524,  525,  526,  527,  528,  529,  530,  531,  532,  533,  534,
	  535,  536,  536,  537,  538,  539,  540,  541,  542,  543,  544,
	  545,  546,  547,  548,  549,  549,  550,  551,  552,  553,  554,
	  555,  556,  557,  558,  559,  560,  561,  561,  562,  563,  564,
	  565,  566,  567,  568,  569,  570,  571,  572,  572,  573,  574,
	  575,  576,  577,  578,  579,  580,  581,  582,  583,  583,  584,
	  585,  586,  587,  588,  589,  590,  591,  592,  593,  593,  594,
	  595,  596,  597,  598,  599,  600,  601,  602,  602,  603,  604,
	  605,  606,  607,  608,  609,  610,  611,  611,  612,  613,  614,
	  615,  616,  617,  618,  619,  620,  620,  621,  622,  623,  624,
	  625,  626,  627,  628,  628,  629,  630,  631,  632,  633,  634,
	  635,  636,  636,  637,  638,  639,  640,  641,  642,  643,  644,
	  644,  645,  646,  647,  648,  649,  650,  651,  651,  652,  653,
	  654,  655,  656,  657,  658,  659,  659,  660,  661,  662,  663,
	  664,  665,  666,  666,  667,  668,  669,  670,  671,  672,  673,
	  673,  674,  675,  676,  677,  678,  679,  679,  680,  681,  682,
	  683,  684,  685,  686,  686,  687,  688,  689,  690,  691,  692,
	  692,  693,  694,  695,  696,  697,  698,  699,  699,  700,  701,
	  702,  703,  704,  705,  705,  706,  707,  708,  709,  710,  711,
	  711,  712,  713,  714,  715,  716,  717,  717,  718,  719,  720,
	  721,  722,  723,  723,  724,  725,  726,  727,  728,  729,  729,
	  730,  731,  732,  733,  734,  734,  735,  736,  737,  738,  739,
	  740,  740,  741,  742,  743,  744,  745,  746,  746,  747,  748,
	  749,  750,  751,  751,  752,  753,  754,  755,  756,  756,  757,
	  758,  759,  760,  761,  762,  762,  763,  764,  765,  766,  767,
	  767,  768,  769,  770,  771,  772,  772,  773,  774,  775,  776,
	  777,  777,  778,  779,  780,  781,  782,  782,  783,  784,  785,
	  786,  787,  787,  788,  789,  790,  791,  792,  792,  793,  794,
	  795,  796,  797,  797,  798,  799,  800,  801,  802,  802,  803,
	  804,  805,  806,  807,  807,  808,  809,  810,  811,  811,  812,
	  813,  814,  815,  816,  816,  817,  818,  819,  820,  821,  821,
	  822,  823,  824,  825,  825,  826,  827,  828,  829,  830,  830,
	  831,  832,  833,  834,  834,  835,  836,  837,  838,  839,  839,
	  840,  841,  842,  843,  843,  844,  845,  846,  847,  848,  848,
	  849,  850,  851,  852,  852,  853,  854,  855,  856,  856,  857,
	  858,  859,  860,  861,  861,  862,  863,  864,  865,  865,  866,
	  867,  868,  869,  869,  870,  871,  872,  873,  873,  874,  875,
	  876,  877,  877,  878,  879,  880,  881,  882,  882,  883,  884,
	  885,  886,  886,  887,  888,  889,  890,  890,  891,  892,  893,
	  894,  894,  895,  896,  897,  898,  898,  899,  900,  901,  902,
	  902,  903,  904,  905,  906,  906,  907,  908,  909,  910,  910,
	  911,  912,  913,  914,  914,  915,  916,  917,  917,  918,  919,
	  920,  921,  921,  922,  923,  924,  925,  925,  926,  927,  928,
	  929,  929,  930,  931,  932,  933,  933,  934,  935,  936,  936,
	  937,  938,  939,  940,  940,  941,  942,  943,  944,  944,  945,
	  946,  947,  948,  948,  949,  950,  951,  951,  952,  953,  954,
	  955,  955,  956,  957,  958,  959,  959,  960,  961,  962,  962,
	  963,  964,  965,  966,  966,  967,  968,  969,  969,  970,  971,
	  972,  973,  973,  974,  975,  976,  977,  977,  978,  979,  980,
	  980,  981,  982,  983,  984,  984,  985,  986,  987,  987,  988,
	  989,  990,  991,  991,  992,  993,  994,  994,  995,  996,  997,
	  998,  998,  999,  1000, 1001, 1001, 1002, 1003, 1004, 1004, 1005,
	  1006, 1007, 1008, 1008, 1009, 1010, 1011, 1011, 1012, 1013, 1014,
	  1015, 1015, 1016, 1017, 1018, 1018, 1019, 1020, 1021, 1021, 1022,
	  1023 },
	{ 0,    6,    10,   14,   17,   20,   23,   26,   29,   32,   34,
	  37,   39,   41,   44,   46,   48,   50,   52,   55,   57,   59,
	  61,   63,   65,   67,   69,   71,   73,   74,   76,   78,   80,
	  82,   84,   86,   87,   89,   91,   93,   94,   96,   98,   99,
	  101,  103,  105,  106,  108,  110,  111,  113,  114,  116,  118,
	  119,  121,  122,  124,  126,  127,  129,  130,  132,  133,  135,
	  136,  138,  139,  141,  142,  144,  145,  147,  148,  150,  151,
	  153,  154,  156,  157,  159,  160,  161,  163,  164,  166,  167,
	  168,  170,  171,  173,  174,  175,  177,  178,  180,  181,  182,
	  184,  185,  186,  188,  189,  190,  192,  193,  195,  196,  197,
	  198,  200,  201,  202,  204,  205,  206,  208,  209,  210,  212,
	  213,  214,  215,  217,  218,  219,  221,  222,  223,  224,  226,
	  227,  228,  229,  231,  232,  233,  235,  236,  237,  238,  239,
	  241,  242,  243,  244,  246,  247,  248,  249,  251,  252,  253,
	  254,  255,  257,  258,  259,  260,  261,  263,  264,  265,  266,
	  267,  269,  270,  271,  272,  273,  275,  276,  277,  278,  279,
	  280,  282,  283,  284,  285,  286,  287,  289,  290,  291,  292,
	  293,  294,  296,  297,  298,  299,  300,  301,  302,  304,  305,
	  306,  307,  308,  309,  310,  311,  313,  314,  315,  316,  317,
	  318,  319,  320,  322,  323,  324,  325,  326,  327,  328,  329,
	  330,  332,  333,  334,  335,  336,  337,  338,  339,  340,  341,
	  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
	  354,  356,  357,  358,  359,  360,  361,  362,  363,  364,  365,
	  366,  367,  368,  369,  370,  372,  373,  374,  375,  376,  377,
	  378,  379,  380,  381,  382,  383,  384,  385,  386,  387,  388,
	  389,  390,  391,  392,  394,  395,  396,  397,  398,  399,  400,
	  401,  402,  403,  404,  405,  406,  407,  408,  409,  410,  411,
	  412,  413,  414,  415,  416,  417,  418,  419,  420,  421,  422,
	  423,  424,  425,  426,  427,  428,  429,  430,  431,  432,  433,
	  434,  435,  436,  437,  438,  439,  440,  441,  442,  443,  444,
	  445,  446,  447,  448,  449,  450,  451,  452,  453,  454,  455,
	  456,  457,  458,  459,  460,  461,  462,  463,  464,  465,  466,
	  467,  468,  469,  470,  471,  472,  473,  474,  475,  476,  477,
	  478,  479,  479,  480,  481,  482,  483,  484,  485,  486,  487,
	  488,  489,  490,  491,  492,  493,  494,  495,  496,  497,  498,
	  499,  500,  501,  502,  502,  503,  504,  505,  506,  507,  508,
	  509,  510,  511,  512,  513,  514,  515,  516,  517,  518,  519,
	  519,  520,  521,  522,  523,  524,  525,  526,  527,  528,  529,
	  530,  531,  532,  533,  533,  534,  535,  536,  537,  538,  539,
	  540,  541,  542,  543,  544,  545,  546,  546,  547,  548,  549,
	  550,  551,  552,  553,  554,  555,  556,  557,  557,  558,  559,
	  560,  561,  562,  563,  564,  565,  566,  567,  567,  568,  569,
	  570,  571,  572,  573,  574,  575,  576,  577,  577,  578,  579,
	  580,  581,  582,  583,  584,  585,  586,  586,  587,  588,  589,
	  590,  591,  592,  593,  594,  595,  595,  596,  597,  598,  599,
	  600,  601,  602,  603,  603,  604,  605,  606,  607,  608,  609,
	  610,  611,  611,  612,  613,  614,  615,  616,  617,  618,  618,
	  619,  620,  621,  622,  623,  624,  625,  626,  626,  627,  628,
	  629,  630,  631,  632,  633,  633,  634,  635,  636,  637,  638,
	  639,  640,  640,  641,  642,  643,  644,  645,  646,  646,  647,
	  648,  649,  650,  651,  652,  653,  653,  654,  655,  656,  657,
	  658,  659,  659,  660,  661,  662,  663,  664,  665,  665,  666,
	  667,  668,  669,  670,  671,  671,  672,  673,  674,  675,  676,
	  677,  677,  678,  679,  680,  681,  682,  683,  683,  684,  685,
	  686,  687,  688,  688,  689,  690,  691,  692,  693,  694,  694,
	  695,  696,  697,  698,  699,  699,  700,  701,  702,  703,  704,
	  705,  705,  706,  707,  708,  709,  710,  710,  711,  712,  713,
	  714,  715,  715,  716,  717,  718,  719,  720,  720,  721,  722,
	  723,  724,  725,  725,  726,  727,  728,  729,  730,  730,  731,
	  732,  733,  734,  735,  735,  736,  737,  738,  739,  740,  740,
	  741,  742,  743,  744,  744,  745,  746,  747,  748,  749,  749,
	  750,  751,  752,  753,  754,  754,  755,  756,  757,  758,  758,
	  759,  760,  761,  762,  763,  763,  764,  765,  766,  767,  767,
	  768,  769,  770,  771,  772,  772,  773,  774,  775,  776,  776,
	  777,  778,  779,  780,  780,  781,  782,  783,  784,  784,  785,
	  786,  787,  788,  789,  789,  790,  791,  792,  793,  793,  794,
	  795,  796,  797,  797,  798,  799,  800,  801,  801,  802,  803,
	  804,  805,  805,  806,  807,  808,  809,  809,  810,  811,  812,
	  813,  813,  814,  815,  816,  817,  817,  818,  819,  820,  821,
	  821,  822,  823,  824,  825,  825,  826,  827,  828,  829,  829,
	  830,  831,  832,  833,  833,  834,  835,  836,  836,  837,  838,
	  839,  840,  840,  841,  842,  843,  844,  844,  845,  846,  847,
	  848,  848,  849,  850,  851,  851,  852,  853,  854,  855,  855,
	  856,  857,  858,  859,  859,  860,  861,  862,  862,  863,  864,
	  865,  866,  866,  867,  868,  869,  869,  870,  871,  872,  873,
	  873,  874,  875,  876,  876,  877,  878,  879,  880,  880,  881,
	  882,  883,  883,  884,  885,  886,  887,  887,  888,  889,  890,
	  890,  891,  892,  893,  893,  894,  895,  896,  897,  897,  898,
	  899,  900,  900,  901,  902,  903,  904,  904,  905,  906,  907,
	  907,  908,  909,  910,  910,  911,  912,  913,  913,  914,  915,
	  916,  917,  917,  918,  919,  920,  920,  921,  922,  923,  923,
	  924,  925,  926,  926,  927,  928,  929,  930,  930,  931,  932,
	  933,  933,  934,  935,  936,  936,  937,  938,  939,  939,  940,
	  941,  942,  942,  943,  944,  945,  945,  946,  947,  948,  948,
	  949,  950,  951,  951,  952,  953,  954,  955,  955,  956,  957,
	  958,  958,  959,  960,  961,  961,  962,  963,  964,  964,  965,
	  966,  967,  967,  968,  969,  970,  970,  971,  972,  973,  973,
	  974,  975,  976,  976,  977,  978,  979,  979,  980,  981,  982,
	  982,  983,  984,  985,  985,  986,  987,  987,  988,  989,  990,
	  990,  991,  992,  993,  993,  994,  995,  996,  996,  997,  998,
	  999,  999,  1000, 1001, 1002, 1002, 1003, 1004, 1005, 1005, 1006,
	  1007, 1008, 1008, 1009, 1010, 1010, 1011, 1012, 1013, 1013, 1014,
	  1015, 1016, 1016, 1017, 1018, 1019, 1019, 1020, 1021, 1022, 1022,
	  1023 },
	{ 0,    8,    13,   17,   21,   24,   27,   31,   34,   36,   39,
	  42,   45,   47,   50,   52,   55,   57,   59,   62,   64,   66,
	  68,   71,   73,   75,   77,   79,   81,   83,   85,   87,   89,
	  91,   93,   95,   97,   99,   101,  102,  104,  106,  108,  110,
	  112,  113,  115,  117,  119,  120,  122,  124,  126,  127,  129,
	  131,  132,  134,  136,  137,  139,  140,  142,  144,  145,  147,
	  148,  150,  152,  153,  155,  156,  158,  159,  161,  162,  164,
	  165,  167,  169,  170,  171,  173,  174,  176,  177,  179,  180,
	  182,  183,  185,  186,  188,  189,  190,  192,  193,  195,  196,
	  198,  199,  200,  202,  203,  204,  206,  207,  209,  210,  211,
	  213,  214,  215,  217,  218,  220,  221,  222,  224,  225,  226,
	  228,  229,  230,  231,  233,  234,  235,  237,  238,  239,  241,
	  242,  243,  244,  246,  247,  248,  250,  251,  252,  253,  255,
	  256,  257,  258,  260,  261,  262,  263,  265,  266,  267,  268,
	  270,  271,  272,  273,  275,  276,  277,  278,  279,  281,  282,
	  283,  284,  285,  287,  288,  289,  290,  291,  293,  294,  295,
	  296,  297,  299,  300,  301,  302,  303,  304,  306,  307,  308,
	  309,  310,  311,  313,  314,  315,  316,  317,  318,  320,  321,
	  322,  323,  324,  325,  326,  328,  329,  330,  331,  332,  333,
	  334,  335,  337,  338,  339,  340,  341,  342,  343,  344,  345,
	  347,  348,  349,  350,  351,  352,  353,  354,  355,  357,  358,
	  359,  360,  361,  362,  363,  364,  365,  366,  367,  369,  370,
	  371,  372,  373,  374,  375,  376,  377,  378,  379,  380,  381,
	  382,  384,  385,  386,  387,  388,  389,  390,  391,  392,  393,
	  394,  395,  396,  397,  398,  399,  400,  401,  402,  404,  405,
	  406,  407,  408,  409,  410,  411,  412,  413,  414,  415,  416,
	  417,  418,  419,  420,  421,  422,  423,  424,  425,  426,  427,
	  428,  429,  430,  431,  432,  433,  434,  435,  436,  437,  438,
	  439,  440,  441,  442,  443,  444,  445,  446,  447,  448,  449,
	  450,  451,  452,  453,  454,  455,  456,  457,  458,  459,  460,
	  461,  462,  463,  464,  465,  466,  467,  468,  469,  470,  471,
	  472,  473,  474,  475,  476,  477,  478,  479,  480,  481,  482,
	  483,  484,  485,  485,  486,  487,  488,  489,  490,  491,  492,
	  493,  494,  495,  496,  497,  498,  499,  500,  501,  502,  503,
	  504,  505,  506,  506,  507,  508,  509,  510,  511,  512,  513,
	  514,  515,  516,  517,  518,  519,  520,  521,  522,  522,  523,
	  524,  525,  526,  527,  528,  529,  530,  531,  532,  533,  534,
	  535,  535,  536,  537,  538,  539,  540,  541,  542,  543,  544,
	  545,  546,  547,  547,  548,  549,  550,  551,  552,  553,  554,
	  555,  556,  557,  557,  558,  559,  560,  561,  562,  563,  564,
	  565,  566,  567,  567,  568,  569,  570,  571,  572,  573,  574,
	  575,  576,  576,  577,  578,  579,  580,  581,  582,  583,  584,
	  584,  585,  586,  587,  588,  589,  590,  591,  592,  592,  593,
	  594,  595,  596,  597,  598,  599,  600,  600,  601,  602,  603,
	  604,  605,  606,  607,  607,  608,  609,  610,  611,  612,  613,
	  614,  614,  615,  616,  617,  618,  619,  620,  621,  621,  622,
	  623,  624,  625,  626,  627,  627,  628,  629,  630,  631,  632,
	  633,  633,  634,  635,  636,  637,  638,  639,  640,  640,  641,
	  642,  643,  644,  645,  646,  646,  647,  648,  649,  650,  651,
	  651,  652,  653,  654,  655,  656,  657,  657,  658,  659,  660,
	  661,  662,  663,  663,  664,  665,  666,  667,  668,  668,  669,
	  670,  671,  672,  673,  673,  674,  675,  676,  677,  678,  678,
	  679,  680,  681,  682,  683,  683,  684,  685,  686,  687,  688,
	  688,  689,  690,  691,  692,  693,  693,  694,  695,  696,  697,
	  698,  698,  699,  700,  701,  702,  703,  703,  704,  705,  706,
	  707,  708,  708,  709,  710,  711,  712,  712,  713,  714,  715,
	  716,  717,  717,  718,  719,  720,  721,  721,  722,  723,  724,
	  725,  726,  726,  727,  728,  729,  730,  730,  731,  732,  733,
	  734,  734,  735,  736,  737,  738,  738,  739,  740,  741,  742,
	  743,  743,  744,  745,  746,  747,  747,  748,  749,  750,  751,
	  751,  752,  753,  754,  755,  755,  756,  757,  758,  759,  759,
	  760,  761,  762,  763,  763,  764,  765,  766,  767,  767,  768,
	  769,  770,  770,  771,  772,  773,  774,  774,  775,  776,  777,
	  778,  778,  779,  780,  781,  782,  782,  783,  784,  785,  785,
	  786,  787,  788,  789,  789,  790,  791,  792,  793,  793,  794,
	  795,  796,  796,  797,  798,  799,  800,  800,  801,  802,  803,
	  804,  804,  805,  806,  807,  807,  808,  809,  810,  811,  811,
	  812,  813,  814,  814,  815,  816,  817,  817,  818,  819,  820,
	  821,  821,  822,  823,  824,  824,  825,  826,  827,  828,  828,
	  829,  830,  831,  831,  832,  833,  834,  834,  835,  836,  837,
	  838,  838,  839,  840,  841,  841,  842,  843,  844,  844,  845,
	  846,  847,  847,  848,  849,  850,  850,  851,  852,  853,  854,
	  854,  855,  856,  857,  857,  858,  859,  860,  860,  861,  862,
	  863,  863,  864,  865,  866,  866,  867,  868,  869,  869,  870,
	  871,  872,  872,  873,  874,  875,  875,  876,  877,  878,  878,
	  879,  880,  881,  881,  882,  883,  884,  884,  885,  886,  887,
	  887,  888,  889,  890,  890,  891,  892,  893,  893,  894,  895,
	  896,  896,  897,  898,  899,  899,  900,  901,  902,  902,  903,
	  904,  905,  905,  906,  907,  908,  908,  909,  910,  910,  911,
	  912,  913,  913,  914,  915,  916,  916,  917,  918,  919,  919,
	  920,  921,  922,  922,  923,  924,  924,  925,  926,  927,  927,
	  928,  929,  930,  930,  931,  932,  933,  933,  934,  935,  935,
	  936,  937,  938,  938,  939,  940,  941,  941,  942,  943,  944,
	  944,  945,  946,  946,  947,  948,  949,  949,  950,  951,  952,
	  952,  953,  954,  954,  955,  956,  957,  957,  958,  959,  959,
	  960,  961,  962,  962,  963,  964,  965,  965,  966,  967,  967,
	  968,  969,  970,  970,  971,  972,  972,  973,  974,  975,  975,
	  976,  977,  978,  978,  979,  980,  980,  981,  982,  983,  983,
	  984,  985,  985,  986,  987,  988,  988,  989,  990,  990,  991,
	  992,  993,  993,  994,  995,  995,  996,  997,  998,  998,  999,
	  1000, 1000, 1001, 1002, 1002, 1003, 1004, 1005, 1005, 1006, 1007,
	  1007, 1008, 1009, 1010, 1010, 1011, 1012, 1012, 1013, 1014, 1015,
	  1015, 1016, 1017, 1017, 1018, 1019, 1019, 1020, 1021, 1022, 1022,
	  1023 },
	{ 0,    9,    15,   20,   24,   28,   32,   35,   39,   42,   45,
	  48,   51,   54,   56,   59,   62,   64,   67,   69,   72,   74,
	  76,   79,   81,   83,   86,   88,   90,   92,   94,   96,   98,
	  101,  103,  105,  107,  109,  111,  113,  114,  116,  118,  120,
	  122,  124,  126,  128,  129,  131,  133,  135,  137,  138,  140,
	  142,  144,  145,  147,  149,  151,  152,  154,  156,  157,  159,
	  161,  162,  164,  165,  167,  169,  170,  172,  173,  175,  177,
	  178,  180,  181,  183,  184,  186,  187,  189,  190,  192,  193,
	  195,  196,  198,  199,  201,  202,  204,  205,  207,  208,  210,
	  211,  213,  214,  215,  217,  218,  220,  221,  223,  224,  225,
	  227,  228,  229,  231,  232,  234,  235,  236,  238,  239,  240,
	  242,  243,  244,  246,  247,  249,  250,  251,  252,  254,  255,
	  256,  258,  259,  260,  262,  263,  264,  266,  267,  268,  269,
	  271,  272,  273,  275,  276,  277,  278,  280,  281,  282,  283,
	  285,  286,  287,  288,  290,  291,  292,  293,  295,  296,  297,
	  298,  299,  301,  302,  303,  304,  305,  307,  308,  309,  310,
	  311,  313,  314,  315,  316,  317,  319,  320,  321,  322,  323,
	  324,  326,  327,  328,  329,  330,  331,  333,  334,  335,  336,
	  337,  338,  340,  341,  342,  343,  344,  345,  346,  348,  349,
	  350,  351,  352,  353,  354,  355,  357,  358,  359,  360,  361,
	  362,  363,  364,  365,  367,  368,  369,  370,  371,  372,  373,
	  374,  375,  376,  378,  379,  380,  381,  382,  383,  384,  385,
	  386,  387,  388,  389,  391,  392,  393,  394,  395,  396,  397,
	  398,  399,  400,  401,  402,  403,  404,  405,  406,  408,  409,
	  410,  411,  412,  413,  414,  415,  416,  417,  418,  419,  420,
	  421,  422,  423,  424,  425,  426,  427,  428,  429,  430,  431,
	  432,  433,  434,  435,  436,  437,  439,  440,  441,  442,  443,
	  444,  445,  446,  447,  448,  449,  450,  451,  452,  453,  454,
	  455,  456,  457,  458,  459,  460,  461,  462,  463,  464,  465,
	  466,  466,  467,  468,  469,  470,  471,  472,  473,  474,  475,
	  476,  477,  478,  479,  480,  481,  482,  483,  484,  485,  486,
	  487,  488,  489,  490,  491,  492,  493,  494,  495,  496,  497,
	  498,  498,  499,  500,  501,  502,  503,  504,  505,  506,  507,
	  508,  509,  510,  511,  512,  513,  514,  515,  516,  516,  517,
	  518,  519,  520,  521,  522,  523,  524,  525,  526,  527,  528,
	  529,  530,  530,  531,  532,  533,  534,  535,  536,  537,  538,
	  539,  540,  541,  541,  542,  543,  544,  545,  546,  547,  548,
	  549,  550,  551,  552,  552,  553,  554,  555,  556,  557,  558,
	  559,  560,  561,  561,  562,  563,  564,  565,  566,  567,  568,
	  569,  570,  570,  571,  572,  573,  574,  575,  576,  577,  578,
	  578,  579,  580,  581,  582,  583,  584,  585,  586,  586,  587,
	  588,  589,  590,  591,  592,  593,  593,  594,  595,  596,  597,
	  598,  599,  600,  600,  601,  602,  603,  604,  605,  606,  607,
	  607,  608,  609,  610,  611,  612,  613,  614,  614,  615,  616,
	  617,  618,  619,  620,  620,  621,  622,  623,  624,  625,  626,
	  626,  627,  628,  629,  630,  631,  632,  632,  633,  634,  635,
	  636,  637,  637,  638,  639,  640,  641,  642,  643,  643,  644,
	  645,  646,  647,  648,  648,  649,  650,  651,  652,  653,  653,
	  654,  655,  656,  657,  658,  659,  659,  660,  661,  662,  663,
	  664,  664,  665,  666,  667,  668,  668,  669,  670,  671,  672,
	  673,  673,  674,  675,  676,  677,  678,  678,  679,  680,  681,
	  682,  683,  683,  684,  685,  686,  687,  687,  688,  689,  690,
	  691,  692,  692,  693,  694,  695,  696,  696,  697,  698,  699,
	  700,  700,  701,  702,  703,  704,  704,  705,  706,  707,  708,
	  709,  709,  710,  711,  712,  713,  713,  714,  715,  716,  717,
	  717,  718,  719,  720,  721,  721,  722,  723,  724,  725,  725,
	  726,  727,  728,  729,  729,  730,  731,  732,  733,  733,  734,
	  735,  736,  736,  737,  738,  739,  740,  740,  741,  742,  743,
	  744,  744,  745,  746,  747,  748,  748,  749,  750,  751,  751,
	  752,  753,  754,  755,  755,  756,  757,  758,  758,  759,  760,
	  761,  762,  762,  763,  764,  765,  765,  766,  767,  768,  769,
	  769,  770,  771,  772,  772,  773,  774,  775,  776,  776,  777,
	  778,  779,  779,  780,  781,  782,  782,  783,  784,  785,  786,
	  786,  787,  788,  789,  789,  790,  791,  792,  792,  793,  794,
	  795,  795,  796,  797,  798,  799,  799,  800,  801,  802,  802,
	  803,  804,  805,  805,  806,  807,  808,  808,  809,  810,  811,
	  811,  812,  813,  814,  814,  815,  816,  817,  817,  818,  819,
	  820,  820,  821,  822,  823,  823,  824,  825,  826,  826,  827,
	  828,  829,  829,  830,  831,  832,  832,  833,  834,  835,  835,
	  836,  837,  838,  838,  839,  840,  841,  841,  842,  843,  844,
	  844,  845,  846,  847,  847,  848,  849,  849,  850,  851,  852,
	  852,  853,  854,  855,  855,  856,  857,  858,  858,  859,  860,
	  861,  861,  862,  863,  863,  864,  865,  866,  866,  867,  868,
	  869,  869,  870,  871,  872,  872,  873,  874,  874,  875,  876,
	  877,  877,  878,  879,  880,  880,  881,  882,  882,  883,  884,
	  885,  885,  886,  887,  888,  888,  889,  890,  890,  891,  892,
	  893,  893,  894,  895,  895,  896,  897,  898,  898,  899,  900,
	  900,  901,  902,  903,  903,  904,  905,  906,  906,  907,  908,
	  908,  909,  910,  911,  911,  912,  913,  913,  914,  915,  916,
	  916,  917,  918,  918,  919,  920,  920,  921,  922,  923,  923,
	  924,  925,  925,  926,  927,  928,  928,  929,  930,  930,  931,
	  932,  933,  933,  934,  935,  935,  936,  937,  937,  938,  939,
	  940,  940,  941,  942,  942,  943,  944,  945,  945,  946,  947,
	  947,  948,  949,  949,  950,  951,  952,  952,  953,  954,  954,
	  955,  956,  956,  957,  958,  958,  959,  960,  961,  961,  962,
	  963,  963,  964,  965,  965,  966,  967,  968,  968,  969,  970,
	  970,  971,  972,  972,  973,  974,  974,  975,  976,  977,  977,
	  978,  979,  979,  980,  981,  981,  982,  983,  983,  984,  985,
	  986,  986,  987,  988,  988,  989,  990,  990,  991,  992,  992,
	  993,  994,  994,  995,  996,  996,  997,  998,  999,  999,  1000,
	  1001, 1001, 1002, 1003, 1003, 1004, 1005, 1005, 1006, 1007, 1007,
	  1008, 1009, 1009, 1010, 1011, 1011, 1012, 1013, 1014, 1014, 1015,
	  1016, 1016, 1017, 1018, 1018, 1019, 1020, 1020, 1021, 1022, 1022,
	  1023 },
};

enum {
	GAMMA_CSC_CTL_BLK = 0,
	GAMMA_CSC_TAB_BLK,
	GAMMA_CTL_REG_BLK,
	GAMMA_CTC_REG_BLK,
	GAMMA_DEMO_SKIN_BLK,
	GAMMA_TAB_REG_BLK,
	GAMMA_REG_BLK_NUM,
};

struct de_gamma_private {
	const struct de_gamma_dsc *dsc;
	struct de_csc_handle *csc;
	bool gamma_tbl_set;
	struct de_reg_mem_info reg_mem_info;
	u8 demo_hor_start;
	u8 demo_hor_end;
	u8 demo_ver_start;
	u8 demo_ver_end;
	u32 reg_blk_num;
	struct de_reg_block reg_blks[GAMMA_REG_BLK_NUM];
};

static inline struct gamma_reg *get_gamma_reg(struct de_gamma_private *priv)
{
	return (struct gamma_reg *)(priv->reg_blks[GAMMA_CSC_CTL_BLK].vir_addr);
}

static void gamma_set_block_dirty(struct de_gamma_private *priv, u32 blk_id,
				     u32 dirty)
{
	priv->reg_blks[blk_id].dirty = dirty;
	if (priv->reg_blks[blk_id].rcq_hd)
		priv->reg_blks[blk_id].rcq_hd->dirty.dwval = dirty;
}

int de_gamma_set_size(struct de_gamma_handle *hdl, u32 width, u32 height)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);

	reg->cm_size.bits.width = width - 1;
	reg->cm_size.bits.height = height - 1;
	gamma_set_block_dirty(priv, GAMMA_CSC_CTL_BLK, 1);

	reg->hori_win.bits.start = width * priv->demo_hor_start / 100;
	reg->hori_win.bits.end = width * priv->demo_hor_end / 100;
	reg->vert_win.bits.start = height * priv->demo_ver_start / 100;
	reg->vert_win.bits.end = height * priv->demo_ver_end / 100;
	gamma_set_block_dirty(priv, GAMMA_DEMO_SKIN_BLK, 1);
	return 0;
}

static int de_gamma_set_csc(struct de_gamma_handle *hdl, u32 en, int *csc_coeff)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);

	if (!en || csc_coeff == NULL) {
		reg->cm_en.dwval = 0x0;
		gamma_set_block_dirty(priv, GAMMA_CSC_CTL_BLK, 1);
		return -1;
	}
	reg->cm_en.dwval = 0x1;
	reg->cm_c00.dwval = (*(csc_coeff)) << 7;
	reg->cm_c01.dwval = (*(csc_coeff + 1)) << 7;
	reg->cm_c02.dwval = (*(csc_coeff + 2)) << 7;
	reg->cm_c03.dwval = (*(csc_coeff + 3) + 0x200) << 7;
	reg->cm_c10.dwval = (*(csc_coeff + 4)) << 7;
	reg->cm_c11.dwval = (*(csc_coeff + 5)) << 7;
	reg->cm_c12.dwval = (*(csc_coeff + 6)) << 7;
	reg->cm_c13.dwval = (*(csc_coeff + 7) + 0x200) << 7;
	reg->cm_c20.dwval = (*(csc_coeff + 8)) << 7;
	reg->cm_c21.dwval = (*(csc_coeff + 9)) << 7;
	reg->cm_c22.dwval = (*(csc_coeff + 10)) << 7;
	reg->cm_c23.dwval = (*(csc_coeff + 11) + 0x200) << 7;

	gamma_set_block_dirty(priv, GAMMA_CSC_CTL_BLK, 1);
	gamma_set_block_dirty(priv, GAMMA_CSC_TAB_BLK, 1);
	return 0;
}

int de_gamma_apply_csc(struct de_gamma_handle *hdl, const struct de_csc_info *in_info,
		    const struct de_csc_info *out_info, const struct bcsh_info *bcsh, const struct ctm_info *ctm)
{
	int csc_coeff[12];
	if (!hdl->private->csc)
		return -1;

	if (!in_info || !out_info || !bcsh || !ctm || (!bcsh->enable && !ctm->enable)) {
		de_gamma_set_csc(hdl, 0, NULL);
		return 0;
	}

	de_dcsc_apply(hdl->private->csc, in_info, out_info, bcsh, ctm, csc_coeff, false);
	de_gamma_set_csc(hdl, 1, csc_coeff);
	return 0;
}

s32 de_gamma_set_demo_mode(struct de_gamma_handle *hdl, bool enable)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);
	reg->demo_ctrl.bits.demo_en = enable;
	gamma_set_block_dirty(priv, GAMMA_DEMO_SKIN_BLK, 1);
	return 0;
}
s32 de_gamma_set_window(struct de_gamma_handle *hdl, u32 x, u32 y, u32 w, u32 h)
{
	struct de_gamma_private *priv = hdl->private;
	priv->demo_hor_start = x;
	priv->demo_hor_end = x + w;
	priv->demo_ver_start = y;
	priv->demo_ver_end = y + h;
	return 0;
}

static int de_gamma_set_table(struct de_gamma_handle *hdl, u32 en, u32 *gamma_tbl)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);
	int i;
	unsigned int *addr = NULL;

	if (!en || gamma_tbl == NULL) {
		priv->gamma_tbl_set = false;
		reg->ctl.dwval = 0x0;
		gamma_set_block_dirty(priv, GAMMA_CTL_REG_BLK, 1);
		return -1;
	}

	priv->gamma_tbl_set = true;
	addr = (unsigned int *)(&(reg->tab[0]));
	reg->ctl.dwval = 0x1;

	for (i = 0; i < hdl->gamma_lut_len; i++) {
		*addr = gamma_tbl[i];
		addr++;
	}

	gamma_set_block_dirty(priv, GAMMA_CTL_REG_BLK, 1);
	gamma_set_block_dirty(priv, GAMMA_TAB_REG_BLK, 1);

	return 0;
}

static int de_gamma_skin_config(struct de_gamma_handle *hdl, bool enable,
			    unsigned int darken, unsigned int brighten)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);
	reg->skin_prot.bits.skin_en = enable ? 1 : 0;
	reg->skin_prot.bits.skin_darken_w = darken;
	reg->skin_prot.bits.skin_brighten_w = brighten;
	gamma_set_block_dirty(priv, GAMMA_CTC_REG_BLK, 1);
	return 0;
}

int de_gamma_ctc_config(struct de_gamma_handle *hdl, struct de_ctc_cfg *cfg)
{
	struct de_gamma_private *priv = hdl->private;
	struct gamma_reg *reg = get_gamma_reg(priv);
	reg->crc_ctrl.bits.ctc_en = cfg->enable ? 1 : 0;
	reg->r_gain.bits.gain = cfg->red_gain;
	reg->g_gain.bits.gain = cfg->green_gain;
	reg->b_gain.bits.gain = cfg->blue_gain;
	reg->r_offset.bits.offset = cfg->red_offset;
	reg->g_offset.bits.offset = cfg->green_offset;
	reg->b_offset.bits.offset = cfg->blue_offset;
	gamma_set_block_dirty(priv, GAMMA_DEMO_SKIN_BLK, 1);
	return 0;
}

int de_gamma_config(struct de_gamma_handle *hdl, struct de_gamma_cfg *cfg)
{
	de_gamma_set_table(hdl, cfg->enable, cfg->gamma_tbl);
	de_gamma_skin_config(hdl, cfg->skin_protect_enable, cfg->skin_darken, cfg->skin_brighten);
	return 0;
}

void de_gamma_dump_state(struct drm_printer *p, struct de_gamma_handle *hdl)
{
	unsigned long base = (unsigned long)hdl->private->reg_blks[0].reg_addr;
	unsigned long de_base = (unsigned long)hdl->cinfo.de_reg_base;

	drm_printf(p, "\tgamma%d@%8x:\n", hdl->private->dsc->id, (unsigned int)(base - de_base));
	drm_printf(p, "\t\tgamma_tbl %s\n", hdl->private->gamma_tbl_set ? "on" : "off");
	if (hdl->private->csc)
		de_csc_dump_state(p, hdl->private->csc);

}

struct de_gamma_handle *de_gamma_create(struct module_create_info *info)
{
	struct de_gamma_handle *hdl;
	struct de_reg_block *reg_blk;
	struct de_reg_mem_info *reg_mem_info;
	u8 __iomem *base;
	int i;
	struct de_gamma_private *priv;
	const struct de_gamma_dsc *dsc;
	struct module_create_info csc;
	struct csc_extra_create_info excsc;

	dsc = get_gamma_dsc(info);
	if (!dsc)
		return NULL;

	base = (u8 __iomem *)(info->de_reg_base + info->reg_offset + dsc->reg_offset);
	hdl = kmalloc(sizeof(*hdl), GFP_KERNEL | __GFP_ZERO);
	memcpy(&hdl->cinfo, info, sizeof(*info));
	hdl->private = kmalloc(sizeof(*hdl->private), GFP_KERNEL | __GFP_ZERO);
	hdl->gamma_lut_len = dsc->gamma_lut_len;
	hdl->cm_bit_width = dsc->cm_bit_width;
	hdl->support_ctc = dsc->support_ctc;
	hdl->support_cm = dsc->support_cm;
	hdl->support_demo_skin = dsc->support_demo_skin;

	if (dsc->support_cm) {
		excsc.type = GAMMA_CSC;
		excsc.extra_id = 0;
		memcpy(&csc, info, sizeof(*info));
		csc.extra = &excsc;
		hdl->private->csc = de_csc_create(&csc);
		WARN_ON(!hdl->private->csc);
		if (hdl->private->csc)
			hdl->hue_default_value = hdl->private->csc->hue_default_value;
	}
	priv = hdl->private;
	hdl->private->dsc = dsc;
	reg_mem_info = &(hdl->private->reg_mem_info);
	reg_mem_info->size = sizeof(struct gamma_reg);
	reg_mem_info->vir_addr = (u8 *)sunxi_de_reg_buffer_alloc(hdl->cinfo.de,
		reg_mem_info->size, (void *)&(reg_mem_info->phy_addr),
		info->update_mode == RCQ_MODE);
	if (reg_mem_info->vir_addr == NULL) {
		DRM_ERROR("alloc gamma[%d] mm fail!size=0x%x\n",
			 dsc->id, reg_mem_info->size);
		return ERR_PTR(-ENOMEM);
	}

	reg_blk = &(priv->reg_blks[GAMMA_CSC_CTL_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr;
	reg_blk->vir_addr = reg_mem_info->vir_addr;
	reg_blk->size = 0x8;
	reg_blk->reg_addr = (u8 __iomem *)base;

	reg_blk = &(priv->reg_blks[GAMMA_CSC_TAB_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr + 0x10;
	reg_blk->vir_addr = reg_mem_info->vir_addr + 0x10;
	reg_blk->size = 0x30;
	reg_blk->reg_addr = (u8 __iomem *)base + 0x10;

	reg_blk = &(priv->reg_blks[GAMMA_CTL_REG_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr + 0x40;
	reg_blk->vir_addr = reg_mem_info->vir_addr + 0x40;
	reg_blk->size = 0x8;
	reg_blk->reg_addr = (u8 __iomem *)base + 0x40;

	reg_blk = &(priv->reg_blks[GAMMA_CTC_REG_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr + 0x50;
	reg_blk->vir_addr = reg_mem_info->vir_addr + 0x50;
	reg_blk->size = 0x1c;
	reg_blk->reg_addr = (u8 __iomem *)base + 0x50;

	reg_blk = &(priv->reg_blks[GAMMA_DEMO_SKIN_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr + 0x70;
	reg_blk->vir_addr = reg_mem_info->vir_addr + 0x70;
	reg_blk->size = 0x10;
	reg_blk->reg_addr = (u8 __iomem *)base + 0x70;

	reg_blk = &(priv->reg_blks[GAMMA_TAB_REG_BLK]);
	reg_blk->phy_addr = reg_mem_info->phy_addr + 0x100;
	reg_blk->vir_addr = reg_mem_info->vir_addr + 0x100;
	reg_blk->size = hdl->gamma_lut_len * 4;
	reg_blk->reg_addr = (u8 __iomem *)base + 0x100;

	priv->reg_blk_num = GAMMA_REG_BLK_NUM;
	hdl->block_num = priv->reg_blk_num;
	hdl->block = kmalloc(sizeof(reg_blk[0]) * hdl->block_num, GFP_KERNEL | __GFP_ZERO);
	for (i = 0; i < hdl->private->reg_blk_num; i++)
		hdl->block[i] = &priv->reg_blks[i];

	return hdl;
}
